I used to wake up at 3.30am most nights. I'd visit the bathroom and then usually read my book until I was sleepy again. I managed to break that pattern. I don't want to suggest it's easy but here are my own ways of tackling it. They work sometimes but not every time:
1. I limit hot drinks to 9.30pm at the latest. (I go to bed around 11.30pm.) This often helps me not to wake up for the loo. Occasionally, I do have a later cup of tea and don't wake up for the loo. Weird!
2. I tell myself three times as I switch off the light, "I will wake up refreshed at 8.30am." (Or other chosen time.) This often works.
3. If I do wake up for the loo, I try not to put any lights on. Lights wake you up! Plug in night lights are good for finding the way to the bathroom and avoiding tripping over the dog! These lights don't emit the blue wavelength that stimulates wakefulness. When I get back to bed, I avoid reading. I lie down straight away and tell myself three times (mentally), "I'll go back to sleep now." That usually works because it breaks the pattern of expecting you'll not get back to sleep.
4. I try my best not to worry and fret about it.
5. I resist napping during the day. I'm not sure it makes a difference, though. I do it really because, as a child, we'd often visit my grandparents. One by one the adults would drop off to sleep. We children would sit under the big kitchen table and listen to the snoring and the big clock tick-tocking and were so bored. The only light relief was seeing the several sets of false teeth that slipped as the grown-ups' mouths dropped open. My nana used to surreptitiously remove hers and put them in her apron pocket to avoid this embarrassment! I vowed then that I would never nap.
6. No tech in the bedroom! No phone, e-reader or TV. You'll hear the phone if it rings in the hall or wherever. How often has it rung in the night over the last decade?
7. If all else fails, I put the light on and read my book!