You're not going to get a great magnesoum source from any foods because bad agriculture practices have stripped most of it from the soil, so a significant amount doesn't make it into our foods.
Magnesium is one of the most important elements to be ingested. It's involved in SO many bodily processes - stress mitigation is one of those.
High intensity exercise (like sprints), cold exposure, and saunas are another great way to help your body learn to deal with stressors.