I suffer teribly with insomnia at times and the doc gave me a leaflet to help.
So other than eating it I have now have decaff drinks (tea for me) at least an hour before bed, stop using electronic gadgets such as computer or game consoles again at least an hor before bed time. Sit quietly for half an hour and have a routine. Jimjams, teeth bed.
Don't read or watch telly or stuff like that just sit in bed for 5 minutes quietly for five minuets and then switch off the light and go to sleep.
If you wake up, get up and sit for five minuets in a chair in a different room and when you get sleepy or bored go back to bed. Keep doing that untill you get used to sleeping in bed rather than fretting.