Electric switch replacement
You have 2 completely different circuits in this box

And you were saying "the breaker"?  There are 2 breakers involved. 

The two circuits most be totally kept separate by a "Chinese wall". Nothing must cross between them. Seriously.  Note that as pictured, nothing does. 

Safety ground, those bare wires, may do so (hey, this could've been a metal box).  But neutral must not. 



I'm a big fan of marking wires.  So I've gone ahead in Photoshop and "marked" the various wires by their purpose/function.  

Left circuit 


Black is always-hot from the breaker and onward to other loads. 
Blue is switched-hot to something (don't know which).  
Gray neutrals in  the back (they're white, just dimly lit) are neutral for this circuit.
The neutral wire nut crosses the "line", but it's insulated, so no big deal. 


Right circuit


Red is always-hot from the other breaker. 
Orange is a switched-hot to a load.  
Yellow is a switched-hot to another load. 
White is the neutrals for this circuit.  


A switch switching the yellow wire needs to use the red hot.
A switch switching the orange wire needs to use the red hot.
That's precisely why the red hot has 2 pigtails. 

A switch switching the blue wire uses the black hot.

If a "smart switch"/dimmer/timer/motion sensor/whatevs needs a neutral, then it needs to  grab the neutral which is partnered to the hot it is using.  For instance a smart switch on the yellow wire, also grabs red, and the partner neutrals to those are in the right bundle.  

No Exceptions.   I don't care if the wire nut is "full" or the wire reaches better. No exceptions.  It's not an arbitrary rule, it prevents house fires, and maintainers from getting shocked. GFCI or AFCI protection devices won't work if the rule is broken. 

Since the cables will not have changed how they enter the box, you should be able to turn the diagram into actual tape markings on your actual wires. All the colors except orange and gray are sold in a $4 5-pack of colored electrical tape. 

This, and knowing which neutrals to use, should make short work of any switch installaions.