I'm writing this to help anyone who might be going through something similar.
NOTE: This is not directed towards people who suffer insomnia where their sleep rhythms are extended or delayed and/or simply aren't tired at normal times of day. This is for insomnia sufferers who ARE TIRED who want nothing more than to sleep, but simply can't or have trouble crossing over due to anxiety, fears, and worries related to sleep.
BACKGROUND: I'm a 30 year old, bodybuilder, never had problems with sleep outside of NOT being sleepy at the right times and being an occasional night owl. Long story short, did a huge diet switch to keto (which, due to the lack of carbs, causes a large reduction in water weight, and a huge loss in minerals), and eliminated pretty much all vegetables. I went mostly carnivore and planned to slowly introduce foods back in to experiment and see if I had any food intolerances. At the time I had no idea how important electrolyte balance was and wasn't focusing on them. Ultimately I became severely magnesium deficient to the point of developing heart palpitations, unexplained irritability, and severe muscle cramps. At the time, I wasn't working and ostensibly had no major stresses in my life. I saved up a ton of money in my graphic design job in the previous year and was essentially "coasting" after being laid off to focus on myself and rebalance mentally. Ironically enough...it lead to the darkest, most traumatic experience I've had thus far in my life (more on this later).
My big mistake was underestimating the stresses I was putting my body through. For starters, the ketogenic metabolic change is a HUGE stress. Imagine eating the standard American diet (high carb) for 30 years and suddenly stopping... Now, I don't wanna get into the science because there are plenty of resources detailing this already, but a massive metabolic shift occurs when switching to low carb, which depletes a lot of minerals and can cause you to feel awful for a few weeks. It's called the "keto flu" and is extremely common with first-time keto dieters. I went through this, but on top of that, I kept up with my heavy workout regiment. This was borderline overtraining. The kicker is this: a lifetime of playing high-stress competitive games, working out all my adult life, and barely eating magnesium-rich foods meant I was already low magnesium, but the recent keto change seemed to be the final nail in the coffin that pushed me into severe deficiency and caused more serious symptoms.
This eventually triggered a panic attack that came out of nowhere. My guess is that the heart palpitations (which I had for about 3-4 weeks) constantly worried me and eventually triggered panic attack symptoms. Normally I'm emotionally resilient, and very stoic. I've had short bouts of depression through most of my adult life, but nothing I'd called "clinical". other than that I've had no mental health issues, no anxiety, nothing. And yet somehow...a panic attack snuck up on me. This is when I learned how important minerals were. When it came, I thought I was having a heart attack and that I was going to die, so it was traumatic. Went to the ER, did an overnight stay, and the typical panic attack rigamaroo where you think you're dying but the doctors say you're 100% fine and that it's all in your head. At the time I resented that, but when I got home, after the doctors found nothing, I started having panic and anxiety symptoms at home, and after a few hours of research, I realized, shit, this is actually a thing. My personality went from masculine, sarcastic, and stoic, to fearful, panicky, constantly ruminating in negative thoughts, worried, needy, emotional, etc. Absolutely NO LIBIDO, NO HUNGER, just constant fear and being way too deep in my own head to enjoy anything. That entire first week was nothing more than severe chronic anxiety. I mean, SEVERE....I was in fight-or-flight from the moment I woke up, 'til the time I fell asleep. The entire week I was getting horrible sleep 1-2 hours at best, then waking up from shortness of breath and elevated heart rates. My heart would start racing every time I went to sleep, or even thought about sleep, and this eventually developed into a form of sleep anxiety where my brain learned to associate sleep with fear.
This is when the real problems started. A full week later, after a week of awful sleep, I was severely deprived, so I attempted to go to sleep, and for 16 hours straight, the same thing kept happening. I'd lay down, heart would start racing, body would go into full panic and fight-or-flight, and I'd be wide awake from the stress hormones, and eventually calm down 15-20 minutes later to be SEVERELY EXHAUSTED, rinse and repeat. This has never happened to me before, and I legitimately thought my brain was broken. I couldn't fall asleep for the life of me. Even lying in bed for 2-3 hours straight, perfectly still, my brain just couldn't shut off. This is when I found out what ACTUAL insomnia was. I desperately wanted sleep more than anything, but couldn't get there no matter how hard I tried, and the worse it became, the more nervousness and anxiety I built up around it...which of course works against you. I used to think I was an insomniac when I stayed up all night playing video games 'til 6am and had to wake at 8am, but NOPE, not even close... now I knew what real insomnia was. The 16 hours ATTEMPTING to sleep eventually drove me crazy, and sent my panic and anxiety into overdrive. I ended up calling 911 begging and pleading with them to find a way to put me to sleep.
If you told me two weeks prior that I'd be pacing back and forth, sleep deprived, panic-ridden, talking to myself, ruminating, catastrophizing, and slowly becoming suicidal, I would have laughed in your face, yet that's exactly what happened. This taught me that ANYONE could become "crazy" under the right circumstances. I was eventually released from the hospital with a trazodone prescription the next morning around 8am (been up for roughly 40 hours now) and eventually ended up passing out around 12pm for about 1-2 hours of awful sleep.
The trauma of everything spiraled into insomnia and severe sleep anxiety for the next few weeks. I lived my life in 30 to 40 hour panic-ridden "phases" with maybe 2-3 hours of sleep in between for the entire first week. It was awful. At the same time I decided I needed to beat this, despite feeling like total shit, panicky, fearful, etc. I had enough presence of mind to go on a strict protocol to fix everything and return back to normal ASAP. Below is what worked for me.
HOW I GOT BACK TO NORMALCY FAIRLY QUICKLY: NOTE: The panic attacked happened December 21st, second ER visit with the insomnia freakout was December 28th and today is January 20th, so it's about a full month later. Chronic anxiety, heart palpitations, and insomnia are pretty much gone. I'm sleeping every night for 5-7 hours, which compared to before is amazing. Even bad sleep is better than no sleep. My life is mostly back to normal and I can function and do my daily activities fine, and after 3 weeks, I can actually laugh again and enjoy life. WOW. It's still a bit fresh so it can still take me up to 2 hours to fall asleep at times, but I eventually always pass out, so I no longer worry about it. I've made big changes however and I'll detail them below.
1. It is absolutely crucial to make sure your magnesium intake is very high. If you have anxiety, your appetite probably isn't the greatest, and even if you're eating a healthy diet, you're likely to be magnesium deficient simply due to soil depletion and the fact that none of us really know if our foods are growing in mineral-rich soils. This is why I highly recommend supplementation of this crucial mineral. I use 'Natural Calm', and take 300-600mg daily. Why so much? Because I'm also a bodybuilder and am using what you'd call a "therapeutic" dose to recover from the traumatic panic/anxiety episode a few weeks ago caused by a severe deficiency, and many expert think the USDA RDA of 400mg is way too low, ESPECIALLY if you're going through a high stress period. This helped TREMENDOUSLY the first two weeks. You literally can feel a calming sensation take over you, and your thoughts become "lighter". Magnesium pushes calcium out of cells and nerve tissue so you're less reactive to stimuli, if that makes sense. The biochemistry is explained, but there's no real way to explain it to most people other than it feels like magic and takes effect very quickly. It felt like my body was so starved for this nutrient that it gobbled it up and put it to work immediately. My palpitations disappeared in a day after I started supplementation. It took a bit longer for everything else (because it's also partly psychological) but it helped tremendously with being clear minded enough to take a more objective look at the anxiety and insomnia.
Go on Amazon and look at the countless reviews for the various magnesium products and you'll see thousands of people raving about magnesium's positive effect on their mood, insomnia and anxiety. If you can't supplement, add a few mag-rich foods to your diet. These include bananas, avocados, dark leafy greens, nuts, seeds, spinach, etc.
There's boatloads of clinical and anecdotal evidence out there on the associations between magnesium deficiency (which is extremely common) and stress, anxiety, insomnia, sleeplessness, irritability, etc. so don't overlook this mineral when you're having these symptoms. There are numerous lectures, articles, interviews, and talks as well. Hit up YouTube, and do some searching. If you want a comprehensive overview, I'd start with Dr. Carolyn Dean; a well renowned and highly sought after expert on magnesium. Magnesium Deficiency 101 - Dr. Carolyn Dean:
https://youtu.be/3td7_91UwrU
2. Force yourself to eat at the same times "daily" (obviously you're living your days in phases with insomnia, hence the quotes, but try to eat regularly) and try to go to sleep around the same times daily. Absolutely no stimulants for obvious reasons. Yes, you'll be tired, you'll have brain fog, you'll be hallucinating, and getting through the day will be rough, to say the least, but you'll be ruling out any deficiencies, as well as working on your circadian rhythm so that you naturally get tired around the same time daily. With constant eating of nutritional meals, you'll be setting a good nutritional base for your body to produce what it needs to produce in order to relax and eventually fall asleep. Do not trust your hunger because it's impaired right now. You NEED FOOD. Do not allow yourself to degenerate any further nutritionally. You will NOT be hungry, but you can chew and swallow, and as long as you can do that, you can't give up on yourself.
Also, note that "relaxing" isn't just an automatic thing, or a "lack of" action. You will need to feed your body the right foods so that neutrotransmitters, and various cofactors involved in the parasympathetic nervous system can become active and in balance with your sympathetic nervous system again so you can rest peacefully and get further and further away from the anxious states.
3. Do all the generic sleep hygiene stuff; switch devices to yellow light, only go to bed when you're tired so your brain associates sleep with your mattress, restrict your sleep to specific hours, don't obsess about the time or obsessively track hours slept, make sure your room temperature is comfortable, etc. I don't need to expand on this because it's repeated ad nauseum here, but the goal is to stack every possible card in your favor so you can wind down and fall asleep.
4. THIS IS VITAL. Do not convince yourself that you have "insomnia" or go into bed thinking you're going to have trouble sleeping. Even if you've been professionally diagnosed. Doctors don't care about you the same way you care about yourself, so keep this in mind. You're one of many patients to them so you need to take control of your own health, and sometimes that means completely rejecting their advice and diagnoses. You need to tell yourself that you're simply going through a rough period and sleep might be difficult, but you're fine. I can't stress how important it is to psychologically believe that things are fine and/or will get better. A major component of insomnia for people who suffer from anxiety is the very anxiety around not being able to sleep. The anxiety compounds the issue and it thus becomes a self-fulfilling prophecy. It's one of the many cases in humans where if you believe it's a problem, it WILL be a problem.
You need to find a way to, over time, decouple the association between sleep and whatever negative delusional spin you're putting on it. Do not predict the future with false and irrelevant evidence from the past. A bad night of sleep, or no sleep the day before does not mean it's going to repeat in the future. This is highly ILLOGICAL, but your brain won't care about this, it will force those thoughts on you. Be aware of your own cognitive behaviors and beat them out with clear, logical thinking. Obviously, this will be difficult since emotional states cause us to think delusionally, and insomnia along with the accompanying sleep deprivation will make it worse, but the big takeaway is to realize that you can't really trust your brain at this time because it isn't functioning properly and is under a lot of stress. This process can take time, be patient with yourself, especially if you think nutrition might be a factor. It's vitally important to remember that YOU CAN FALL ASLEEP. EVERY HUMAN HAS THIS ABILITY unless you have extremely rare genetic disorders or severe nutritional deficiencies that can EASILY be corrected.
You need to realize that it's ENTIRELY NORMAL to have problems falling asleep for days, weeks or even months at a time. Your case is likely NOT UNIQUE, and many millions of people over millenia have suffered and successfully recovered from this disturbance. It is scary because it is happening to YOU, but take comfort in the fact that it is also common and treatable. This is not blind hope, or lying to yourself, these are FACTS THAT YOU NEED TO CONSTANTLY REMIND YOURSELF OF because your brain will already be doing a great job of bringing you down with negative thoughts. You must truly believe that you're going to get better and fix the problem, while taking every possible step you can to move the dial in the right direction towards progress.
Take comfort in the fact that many people have sleepless periods like this for various reasons. Stress, nutritional deficiencies, terrible diets, anxiety, grieving, depression, breakups, divorces, etc. It's crucial to remember that all psychological stresses will diminish over time and you will return to normalcy. Your brain is constantly adjusting towards homeostasis, so YOU WILL HEAL IN TIME. YOU MUST KNOW THIS. Don't get obsessive over how long your recovery is taking, or set arbitrary goalposts (e.i. "I should be fine in a week"). Take things one day at a time.
Also be aware that stress depletes magnesium, which is responsible for reining in ruminating thoughts and relaxing you. Again, I urge anyone with insomnia and/or anxiety to do ample research on magnesium. It is absolutely a life safer. Here's a really good video emphasizing some of the points made above:
https://youtu.be/ZGFVxQiLH8k
5. Last part is to remember that falling asleep is an automatic and passive act. You can't force it. This is the biggest mistake I made when I first encountered insomnia. You need to simply achieve a relaxed state while drowsy, and your brain will do the rest. Think back on previous times you fell asleep and note how you didn't do anything special. You closed your eyes, perhaps started thinking about the day or fantasizing, and eventually fade out. I had the biggest trouble with this for what seemed like an eternity, but eventually learned to simply stop worrying about getting sleep. Close your eyes, relax, let your thoughts wander to daily stuff; sex, work, social interactions, family, future plans, women, men, wherever your natural fantasies lie, and it eventually happens...you wake up, and the next thing you know it's a couple of hours later.
IN CLOSING I know this is difficult, and this is probably oversimplified, but it's important to not get frustrated if you don't get instant results. You will get better a little bit at a time. If you slept fine in the past, there's absolutely no reason to believe that you won't sleep fine in the future. There's a reason why cognitive behavioral therapy for insomnia is so effective, because truly, for many of us, it's in our own heads. The human brain is an amazingly powerful and complex organ, and its power is such that it is also amazing at self sabotage. Keep this in mind when dealing with negative thoughts. I've also found it helpful to not AVOID negative thoughts. Write them out and or follow them through to their endings in your head. At times you realize how hilariously delusional many of your thoughts are, and how unrealistic they are. If you can find humor in them, the fear lessens, and they end up as "processed" thoughts. That thought can no longer bother you. Hence why facing your fears and confronting your negative thoughts works so well, because, in truth, the vast majority of our worst fears
NEVER COME TRUE. At the same time, it's important not to over obsess and be in your head all the time. DO seek out distractions and ways to get your mind off your issues, but not to the point of total and complete avoidance, as avoidance reinforces fears.