The first way is for when reliable sources inform you the boss is on the way out. You will have to show respect and loyalty to the boss until the moment of the termination. That's just the way it is. After all, the grapevine could be wrong. Moreover, as the tenision builds, everyone is observing how you comport yourself. Handle yourself well and you could come out of this better than you were before. At the same time you are being a good soldier you are also in a cautious manner showcasing your talents to a wider audience. "They" could have you in mind to replace the boss.
The second way is when the firing actually takes place, after being rumored, or if it occurs abruptly. Here are the rules of the road: Stay calm.
This is called grace under pressure and it's rated as a plus. Don't stumble around like the walking wounded. The organization has taken a hit. The fewer souls it needs to tend to, the quicker it can heal and move on. Don't ask, don't tell.
Don't discuss the situation with peers or subordinates. Remove yourself from cabals who do sift through both gossip and facts, using all media, ranging from phone to e-mail to in-person. Simply continue doing what you're supposed to be doing. If you have a confidential pipeline, contact that person that evening from your home. Communications could be monitored. If officially informed.
The powers that be tell you what they want to about the reason for the termination and what will happen next. Thank them for the information. Don't ask questions. End of story. Past promises get voided.
Be willing to accept that the contract established between the boss and you might be worthless, unless it was in writing. If it was verbal, suck up the loss and disappointment and be willing to begin over. Volunteer to help out.
Ask the powers that be how you can be most helpful. Do what they recommend. If a new boss is appointed, also offer to do whatever is needed. When guilty by association.
You were a known ally of the boss. Do all the above. Nothing may happen to you. However, anticipate hostility from your former superior's enemies. Meanwhile, as you wait for the dust to settle, you might want to contact an employment lawyer to find out how to respond as well as negotiate if fired. Also, assess whether you should begin a job search. Usually it takes a master player to survive if you placed your bet on the wrong horse. Actually, if there had been rumors of "changes," you probably already have begun a job search. Change can mean opportunity.
In many ways, this is a new start for you to demonstrate your skills to the organization. You may be one of the few who can identify what needs to get done. Communicate that to superiors, along with a plan how you can get it done.
More from PayScale:
Best High Paying Jobs
Top Paying Professions Over $70,000
Physically Active Jobs