I have a few ways that help me relax and prepare for bed. First, I'd recommend turning off all screens at least half an hour before you sleep - the blue light from electronic devices can keep you awake and disrupt your rest.
Then, instead of focusing on falling asleep right away, try doing something relaxing like reading a book or journaling. It distracts your mind and helps put those racing thoughts to rest. Also, avoid thinking about sleep as this can be counterproductive - focus on the activity at hand and unwinding.
Finally, developing a nighttime routine helps signal to your body that bedtime is approaching. This could include things like lowering the lights, putting on some soothing music, or taking a warm bath. Each person's different, so find what works for you and make it a consistent part of your pre-bed ritual!