Tip
You can become magnesium deficient RAPIDLY due to fever or vomiting. Signs include light and noise sensitivity.
You can become B vitamin deficient RAPIDLY due to sweating -- hot weather, fever, hard work.
Make a list of "usual suspects" for your situation. Post it someplace PROMINENT. Run through it when you start having behavioral issues or other symptoms.
If you get magnesium deficient, you may ALSO need more calcium. These tend to go hand in hand.
If you need more calcium, you may ALSO need vitamin K and/or vitamin D. These also work hand in hand and you won't get the most out of any one of them if one of the others is too low.
You may need to be very persistent for a long time with certain issues before you reach some kind of stability where it's only occasionally an issue requiring crisis management. It can take time to redress longstanding deficiencies, chronic infection, etc. and develop new habits that help keep things running well.
Some potential indicators you will need to be persistent for a long time: If you have a genetic disorder, any chronic health issues or are part of a demographic (possibly associated with ethnicity) prone to certain issues (for example, Black Americans are prone to high blood pressure).
If you were self medicating previously with large amounts of OTC meds, illicit drugs, alcohol or caffeine and developed a high tolerance: Your high tolerance can and likely WILL reverse if you resolve the underlying health issue that drove your previous craving and will likely follow a "two steps forward, one step back" pattern for a time.
Tolerance develops at the cellular level and involves the cell literally growing its capacity to process specific chemicals by growing certain cell parts above the standard issue amount. It takes time to shrink the cell parts that previously grew to handle the amount of chemicals you were imbibing.
I believe this is part of why I went through a process of getting off certain medications temporarily and then going back on them at a lower dose one or more times before quitting entirely. I initially felt like a failure when I would go back on some medication I had temporarily stopped needing but I eventually realized I always went back on at a lower dose.
I think I temporarily had a backlog of chemicals in my system and didn't need to resupply for a time, then it dropped below a certain threshold and I needed to resupply, but at a lower level. And I think changes at the cellular level were part of that pattern: Something likely shrank, leaving me with a lowered ability to process out those chemicals.
If you are going through this: Just keep at addressing the underlying health issues.
You aren't a failure. You just need more time to fully resolve it.