Its good you are aware of this. Good sleep hygiene is very important. Many many of us have sleep issues. Very common for us.
Two nights ago I didn't sleep a wink. I don't know why....hypo manic in a weird way maybe. Last night I slept like a baby.
Dark, quiet, adequate external lighting when looking at your phone or computer. Blue light from screens messes up sleep hormones. No blue light if you wake up during the night. Relaxation techniques, etc.
Maybe try Melatonin. That often gets messed up in us. It might help.
Melatonin-Overview
Chamomile Tea before bed has helped me lots of times.