1)Valerian root can help with mild insomnia but isn't potent enough to be reliable.
2)Melatonin tablets are good for more severe insomnia but are slightly more risky since melatonin is something naturally produced by your pineal gland, and taking supplements may alter your natural chemical balance.
3)A single puff of marijuana right before lying down is reliable and effective for preventing insomnia, nightmares and sleep paralysis. This can also be used in the middle of the night after there has already been a problem to prevent recurrance of nightmares and sleep paralysis attacks. I'm not sure if it's the same for others, but for me, such things usually happen in clusters, and it is extremely comforting to have a small amount somewhere near your bed where it can be reached easily in case of emergencies. (This seems to be the ideal cure, but it's expensive, illegal, and isn't always available. It's also hard on the lungs, so if you are going to try this treatment, I recommend investing in a small water bong to minimize the discomfort, especially if you aren't used to smoking anything.)
I might have to try what Heart recommended to see if it's more effective, although my tendency is to prefer natural remedies whenever possible because I am always somewhat concerned about the health risks and side-effects of man-made drugs.