There are times when getting fired can be a blessing in disguise.
Yes, it is an awful feeling to not know where your next paycheck is coming from, and the shock can be a lot when it is something that you are not expecting. Still, there is every chance that the role was one in which you were not fully appreciated, and under management that caused far more problems than it solved.
Even when there are positives to being ousted from a job, that doesn’t stop it from being a painful and often insulting experience. Everybody wants to leave a position on their own terms, not be told that it has been decided for them by somebody else. Depending on the situation, there can be ways to act that allow the ex-employee to retain some of their power, but that is not always possible. The best thing to do is move on quickly.