So, there are many different medications that have a side effect of insomnia and these are commonly used to treat many of the common medical problems seen in our society. One medication is beta blockers, which is used to treat hypertension and irregular heartbeats. Beta blockers tend to suppress melatonin and have the side effect of insomnia as well as nightmares.
Another class of medications that are used to treat depression are SSRI's or serotonin reuptake inhibitors. They effect serotonin levels, which can also cause insomnia. Now, in this category there are different medications which have more of a side effect of insomnia and less of a side effect. So, if you do need this medication to treat depression, it's important to discuss with your physician which of these is the best to take.
Now, corticosteroids, which is commonly used to treat asthma and help with reducing inflammation, can also trigger insomnia. They affect your adrenal glands and can also trigger the fight or flight response from your adrenal glands. This will also cause insomnia at night.
Many medications used to treat ADHD will also trigger insomnia. These are stimulants which help you stay awake, so taking these too close to bedtime or in the middle of the day can also trigger insomnia if you're not metabolizing these medications fast enough.
Medications to treat thyroid disorders can also trigger insomnia if you are overdosing on medications for hypothyroidism and other medications that have caffeine as part of their makeup can also trigger insomnia, such as medications for migraines.
So, it is really important to discuss with your physician what medications might be causing your insomnia and see if you could change them to a different medication to help treat the same health problem.