If you are already at systems level programming field (C/C++) you can tackle on Rust, which is becoming more and more popular (Linux Kernel, Microsoft in the future, etc)
Similarly, you can probably learn Python and (given your interest in math) data science, or TypeScript and web dev (may not be the most rewarding career but it can buy you time to pivot to something else). If you have been writing code for a while you should be able to pick up a specialization to a junior level in a few weeks, and some places will let you do that learning on the job. Good luck, and don’t give up.