Im really bad at this myself but when I stick to good sleep hygiene it definitely makes a difference. (Not doing anything other than sleeping in my bed, waking and going to bed at consistent times, getting out of bed if I go longer than 20 mins without falling asleep, not being on my phone in bed, that kind of thing)