Meditating right before going to bed, given that you haven't stared at any screen for an hour prior, can help tremendously with insomnia. That and intense and regular exercise, a clean diet, hydration... Healthy habits, to cut it short. Also, make sure your bedroom is dark and its temperature is cool.