I was perfectly healthy before 2016 (other than some sleep issues) and then experienced a very traumatic psychotic episode, which was quite life-changing (for the worse, unfortunately)! I ended up in a semi-vegetative state and had to go on disability for 6 months because I couldn't sleep and my mind just wouldn't function (random intrusive thoughts or memory retrieval issues like "blanking" when trying to remember really basic facts, headaches and inability to concentrate, items disappearing from working memory). For a while I thought that I'd lost the ability to program forever, thankfully my situation has improved significantly since then. Even 6 years later, I still experience hallucinations, I still have frequent headaches and strange symptoms:

- random sporadic pain in many parts of my body that wasn't there before

- tardive dyskinesia: involuntary twitching or muscle spasm, "forced" movements

- strange salient events, for example my computer sometimes behaves like it is hacked, devices stop working in ways that defy the laws of physics, or time even sometimes feels like it is flowing faster than it should

- background tinnitus that prevented me from sleeping well for years (although I've gone from being tired all the time to having a decent level of energy over time)

- frequently angry "voices" that occasionally say rude and nasty things (as well as some nice ones that suggest interesting thoughts)

- "entities" that attempt to manipulate or coerce me into working on their causes - change your career, become a doctor, become a politician, become a spy (although some of them are nice and a few of them provide some great ideas).

I was diagnosed with paranoid schizophrenia and required to take medication which keeps the worst of the symptoms somewhat under control.

This experience made me much more humble, patient, and sympathetic to those suffering from mental illnesses. I also realized how fragile life is. Even as a very successful software engineer, you are about 2 weeks of no sleep away from turning into a zombie or completely broken person.

It also really changed my outlook on life. I used to be somewhat religious, and still believe that there are higher powers out there, but compared to the Christian perspective of a loving and caring God, some of them are downright cruel and vengeful. Chances are that to them, you're just some minisculine speck in the universe and utterly disposable. Perhaps you're some kind of a tool in a grander scheme. The world doesn't "owe" you anything even if you do everything right, and it will crush you into a pulp if the powers that be feel that is advantageous to their interests or maybe even just on a whim.

Lessons and takeaways:
- Make sure you have a strong support network: friends and family are what got me through this mess, I never would have made it through this hell without them.
- The world is not fair. Maybe it's some kind of a test, or the karma is extremely delayed. But some people have it really rough, and until you've been there, you might not appreciate what others are going through.
- Be kind to others and treat everyone with respect. Perhaps you'll be in their shoes someday.
- Don't upset anyone or anything. You never know who you might tick off and how they might retaliate.
- Curb your ambition and anger, and learn to live with and accept frustration and things not going your way. The world will knock you down when you least expect it, and it will kick you while you're lying on the ground. I'm a lot less ambitious than I used to be, I'd say that on many days I'm just treading water. If you have 0 expectations, at least it's unlikely that you'll end up disappointed. Often times, your interpretation of an event has a bigger influence on your happiness than the actual outcome of the event itself.
- Appreciate what you have, even the very basic things in life. Food. Water. Shelter. Electricity. Sleep. Silence. Time. A functioning mind. A universe where the laws of physics are consistent. Many people take these things for granted, and then one day they're gone and you start to realize how valuable these things are/were. Most of the things listed above don't even cost that much. Perhaps they should be essential human rights.
- You are stronger than you think. Even in the darkest times, don't give up, just take it step by step, day by day. It gets better with time (hopefully). Perhaps even the wrath of God is subject to a statue of limitations.