Thank you Dominus and Unloadonme for your input. I appreciate it very much. I haven't done research into insomnia because I just thought there wouldnt be any answers but I should probably look. I know about having a 'clean environment' where you sleep. Not looking at blue screens an hour before sleeping, etc.
There are other things you can do, although not everything affects everyone in the same way. One of the most common is to avoid caffeine in the evening. Some foods can also keep you awake. Also try to make sure you're actually tired when you go to bed, so get up at a reasonable time in the morning, try to be physically active (even if you're not working you could go for a walk, dig the garden, wash the car, join a gym, anything really) and don't nap during the day. You might not find an outright cure for your insomnia, but you'll probably find things which help.

