How to get rid of horniness at night

So sometimes i have this problem when at night, i feel really horny.

I dont want to exercise (for example: jumping jacks) to get rid of the horny because I wanna go to sleep, and not get active and be wakeful.

And also, what should I do if I really want to sleep, but I just can't (phone already put aside, and trying to sleep, but even after 30 mins nothing happens).

Any advice?