Wind down 30-60 minutes before bed. Journal, mediate, breath work, go for a walk, speak with a friend. Internal dialog to address outstanding thoughts and worries. You're trying to calm the rumination cycles that will keep you from falling asleep and going back to sleep.