I stuggle with insomnia too- have done for as long as I can remember, although over the last few months its got worse. Ive been to my GP who has given me 3 different types of sleeping pill- some which work for the first couple of nights, other which dont work at all. I make sure I have a healthy sleep hygiene routine- warm bath before bed, no TV before bed, dark quiet room etc. Getting off to sleep isnt such an issue, but I wake up every night about 2.30am and can't get back to sleep. I too am on the verge of losing my job
I feel for you - its frustrating to say the least and has a massive impact on day-to-day living.