It appears that you have two rheostats there.
What I would do is buy a wireless remote for the fan and light then all you need is a regular toggle switch for the fan and light. The remote will control both. In that case you would cap off one of the switch loops in the wall and ceiling box and use the other as your power switch. You just leave this switch on since you'll be controlling the fan and light with the remote.
Pictures of the all the wires connected by each wire connector in the junction box is needed to make simple descriptions. Picture of the label on the side or some kind of indicator whether the red or yellow is power out to the fan. Also if you expect the switch to turn on fan and light, or whether you expect the switch to control one function
Please take many pictures of the wire connections before disconnecting anything. Also we can't really see how many wires are connected to each connector. This doesn't really make a operation difference, but makes a difference how much confusion we create trying to describe the connection. To make any connection where more than one wire needs to be connected to a terminal you may need to create a "pigtail" by adding an additional 4-6" piece of #12 wire to the existing wires and connecting that one wire to the switch. We also don't know what type of connections are available on the replacement switch.
Basically the black is probably the hot into the switch, red switchleg out to fan, yellow switchleg out to light.
You need to connect the wire(s) connected to the black to the "line" on the new switch, if using a simple switch with matching screws use either screw, or it could be labeled line, hot, be a gold screw.
The wires connected to the red need to be connected load terminal, it could be labeled load, or just be the other screw of the switch. Now the switch will control the fan.
If you want the light to turn off and on with the fan connect the wire connected to the yellow to the same wires the red was connected to. If you want the light to only be controlled by a chain on the light the connect the wire connected to the yellow to the hot side of switch.