First, limit water and food at least two hours before bedtime. Remember: Intake dictates output.
No evening napping. Often dogs will deep sleep hours before we actually go to bed. If that is the case, then they will be well rested at 4am and will want to wake up and go potty. If they are kept awake until you sleep then they will sleep through those urges.
Make sure your dog goes outside to potty before bed-even if that means they have to go on a walk. Give HUGE praise when they do anything they are supposed to.
Create a nighttime routine: TV off, hallway light off, outside light off, etc. This will let them know that they have to go potty because you are headed to bed.
Try to wake up before they do. If they can wake you to potty, then they will learn that waking you up gets a reward of a bladder release. As they get better, set the alarm for later and later until they sleep through the night.