I have chronic insomnia. I have trouble going to sleep and then I have trouble staying asleep. It ruined my life for years because of trying to get up and work a daytime job.
Two things have saved my life:
1) The doctor put me on Ambien. It's not enough to get me more than about 4-5 hours sleep a night, but I can function on that. I highly recommend it if you are chronic.
2) I started my own business where if I need a nap in the day, I just take it.
I know a lot of this thread is light hearted, but seriously, insomnia stole my life for years. If you have trouble functioning, just know that there is help for you. I didn't seek help for years because I thought all sleep medications were the same and I didn't want to get hooked on something. I wish I had known then what I know now.