1. Military Coup D'etat- simply enter the thoughts of every soldier and general immediately after being informed of the coup. Then, the thoughts will say whether they're supporting the coup, resisting it, or hiding from it.
First, improve working conditions for the entire military (wage increases and normal training, and more prestige). Also, try and get closer to the Militarist Faction. Try to rally as much support for El Presidente as possible.
For those hiding, send a banker to bribe him. Hopefully, the coward will join the loyalists.
For those as loyalists, bribe them, reward them, whatever.
For the treacherous faction of the Tropican military, have the police come and arrest them. No one can resist an arrest, and they can't fight you from jail. Once they're in prison, they won't thus count in the coup d'etat.
2. Rebellion- improve the overall island conditions. Such as a free press, fair elections, increasing the minimum wage, better labor conditions (no "sweatshops", or "special-op training), and a higher support of all the factions.
Next, take Plan B preparations. Get the absolute backing of the entire government- the bureaucrats, soldiers, generals, and policemen (better conditions, higher wages, better prestige, etc.). Make sure you can issue the "martial law" edict, and be able to supress discontent from the people. Also, repeal the "conscription" edict, because some conscripts will just join the rebels instead. Order lots of immigrants to come serve in the Tropican military.
After all the preparations, put it all into action. Then, after a month or two of this, or after the general happiness of the country has imporved, issue the "amnesty" edict. Hopefully, the rebellion will end after this, if not, you'll have to start Plan B. Then, you will have to beat off the rebels in battles.
3. Elections- make sure you always have the upper hand in the elections. You might want to check the "candidate support" section of the almanac after you allow the election. Try to appeal as much as possible to the larger factions. You might want to also bribe the faction leaders, as well as bribe the indifferent (or "leans towards") voters. After all, every vote counts. Also, build media structures, and have full staffs and low prices, near lost of people. Make sure the structures blare propaganda, and have electrical power. It is also a good idea to bring in waves of immigrants, as they tend to favor you in elections, especially since you brought them here (the ordered ones). The other immigrants are more indifferent. It might be a good idea to do election fraud if it seems like it'll be too close. If it looks really bad right before election day, it'll be a smart idea to issue the "martial law" edict, which automatically cancels upcoming elections.
4. Popular Uprisings- though I have had to fight off many coups, hold back some rebels, and win a bunch of elections, I've never experienced a popular uprising before (despite my experiments). Please tell me what they're like!