I apologize for not answering this sooner, as tumblr took notification away I haven’t looked in my askbox recently. Insomnia is a sleep disorder that makes it hard to get an appropriate amount of sleep. It generally affects one’s ability to fall asleep. It can have many causes. The best way to prevent insomnia is to attack the root cause. This can be physical, mental, genetic, or even unknown.
In the case of a physical cause: one must cure the physical ailment that is preventing sleep loss. Like an illness or injury: these tend to subside easiest.
Mental causes of insomnia are generally linked to complex psychosis behavior: much like any other mental illness the best way to treat it is to seek medical help and find a prescription that works with your brain chemistry. There are plenty of behavioral changes that can affect this: eating healthier, drinking fluid, keeping your phone and computer in a place you cannot reach, meditation.
Genetically caused insomnia, is more or less impossible to outright cure, medications and training tactics can sometimes work but in the end your body and schedule can occasionally readjust. I recommend sleep studies for these individual.
Insomnia can also be habitual, meaning you have accidentally or willingly changed your behavior; to cure this instance can take days, weeks or even months of reconditioning your body to sleep at normal times.
Computers may not always need sleep, but they need to restart in order to update.