If you get up you're training yourself to have insomnia. Don't read or watch TV in bed. Melatonin may be nature's sleeping pill. Take 1 to 3 mg 30 to 60 minutes before bedtime. They are helpful for some people but may cause daytime sedation, impairment of motor skills or dry mouth.
Prescription sleeping pills can be valuable for short term or infrequent use.
Your doctor can prescribe one that's right for you. Regular exercise will improve your sleep. Training in relaxation techniques is the most powerful cure for insomnia. It requires an investment in time and energy to learn and practice the technique. The advantage is that it's natural and once you master it you can use it for the rest of your life.