If you have trouble sleeping then just try having sex before bed because it can actually help you fall asleep AND help you stay asleep.
Having an orgasm produces oxytocin which counteracts the stress hormones that your body produces. So,you end up in a more relaxed state and able to fall asleep much faster. And for women, the increase in estrogen levels will help you achieve REM sleep cycles. You’re welcome!