If your sleep schedule is all over the place, then I would focus on that first.
Really focus on sleep hygiene, making sure your bed is for sleep (or sex) and sleep (or sex) only. Lying awake? Get up & go downstairs.
Want to read? Choose a comfy armchair
I've been an insomniac since 13 & had my most severe period during a time of great stress about 4 years ago, in which I barely slept for weeks on end. These days, although not perfect, I sleep better than I have done since childhood. My other tips are:
Create a wind down routine in the evening. Mine starts from 6pm when I get home from work and start unwinding from the day with a shower & change of clothes. From about 8pm, I'll dim lights (n/a in summer obviously) and dim screens on my devices & TV. From 10pm a use a blue light filter on devices (as a nightowl I only sleep at 10 if I'm ill)
I stop drinking caffeine (only drink tea) from about 3 or 4pm, sleep experts will say stop earlier but I don't think caffeine really keeps me awake if I'm honest, it's more of a psychological thing.
I also use warm-light ulbs throughout the flat, not white-light ones and use lots of lamps / dimmer switches, which means the lighting I use layer in the evening has a lower wattage & I save white light bulbs & bright lights for task lamps. This meant I thought about how & when I used lighting.
Eat healthy.
Practice Mindfulness/meditation etc
In the morning, expose yourself to daylight as soon as you wake & make sure to spend some time outside during the afternoon, even if only 10 minutes.
A glass of milk is great for helping you to nod off. Warm if you like, I prefer cold.
Magnesium can help you drop off, too. I use herbal otc sleeping tablets.
If all else fails and you're getting desperate, ask for a short prescription of sleeping tablets to help.