As other people have said, you can buy over the counter sleeping pills at any drug store without a prescription. These include benadryl, tylenol pm, sominex, nytol, excedrin pm, etc. They all have the same active ingredient: Diphenhydramine.
These sleeping pills work well for some people. However, if you have a big problem with insomnia, you might need prescription sleeping pills. These include ambien, atarax, vistaril, elevil, desyrel, etc. There are also anti-anxiety meds called benzodiazepines. For sleep, restoril, prosom and dalmane are suggested.
All sleeping pills pose some danger. It is easy to get dependent on them. Once you stop taking them, your insomnia can return. Especially be aware of the benzos like restoril that I listed above. These can be addicting and hard to get off of.
Here is a long list of more natural approaches to insomnia. The list is so long that reading it may put you to sleep :-)
There are herbs that can help you to sleep, eg, valerian root, kava kava, chamomile, hops, passion flower, skullcap. Probably, valerian root and kava kava are the best. You have to keep in mind that it can take a few weeks for some herbs (including valerian) to build up in your system before they work.
You can also try 5-HTP, trytophan or melatonin (about 3 mg). I would not take melatonin for over a month unless your doctor says it is ok.
A warm bath is a great way to help you to sleep. If you can’t take a bath, you can give yourself a foot massage with slightly warm massage oil, sesame oil, or castor oil from a health food store.
What was very helpful to me, especially when my mind was racing, was to lie in bed and listen to relaxation CDs, especially those that contain someone speaking with relaxing music in the background. Many of these CDs are available on eBay for very low prices.
A helpful technique is to relax your body one part at a time. So you could relax your feet, your lower legs, upper legs, moving up from your lower belly up to your chest, etc., until your whole body is relaxed.
Of course, guided relaxation methods can help, imagining yourself in the country, the beach, or whatever is most soothing to you.
If you have annoying thoughts or personal issues that run thru your mind when you are trying to sleep, you might have to deal with those issues first. You might want to talk to a counselor or therapist about that. I suggest avoiding prescription sleeping pills unless nothing else helps.