1)Have a cold shower before bedtime. It must be cold as your body gets steadily warmer and so you must disperse this heat. This will cool the hotness and the horniness.
2)Do not think sexy thoughts before bed.
3)If you wake up in the middle of the night, don't go back to sleep. So for instance, if you go to bed at say 10pm and wake up at 4am, do not go back to sleep. From my own experience, I noticed you usually ejaculate on these "second sleeps" rather than the deeper first sleeps. I'd advise to read a book, watch tv or listen to music. Avoid earphones as they can damage your hearing and cause tinnitus (a constant ringing).