What to do when you get fired?
Negotiate the terms of your separation.  Check if you are eligible for unemployment benefits.  Ask for references.  Know your rights.  Take time to process everything and take care of your mental health.