Restless legs is a strong urge before sleep to repeatedly move ones legs preventing sleep. If severe it can be treated with levodopa, opioids, or benzodiazepines. Sleeping pills may stop working after two weeks and it can take several weeks to recover from their effects. They can also exacerbate sleep apnea. If you are on pills, reduce the dose by a quarter weekly.
Exercise works better than pills.
Good sleep hygiene means the same bedtime, later rather than earlier. The same arousal time. Get enough exercise, avoid alcohol, caffeine, nicotine, and excessive fluid in the evening. If you get stomach acid reflux or pain, treat them before you settle. If you're overweight, you'll sleep better when you slim.