I wake up at 3 am consistently and can not go back to bed.
What have you tried? We're working on a wearable which measures your sleep state and influences and trains your brain for better sleep performance. Still in development, but check it out https://soundmind.co
use melatonin
My understanding (based in part on personal experience) is that melatonin helps mostly with falling asleep, but not necessarily with staying asleep.
What / how much do you eat / drink in the afternoon and evening?
Maybe you are not tired enough. One advice a professional gave was to not stay in bedroom unless you go to sleep and also no other sofas in the house for too long.