Trying to install a dimmer switch for my light attached to my ceiling fan
The red wire powers the fan, yeah

The existing arrangement has separate power wires for the light and the fan running from the switch box to the fan box.  This is a great thing, because it means you can pretty much do whatever to control the light and the fan separately, instead of having to faff with fan remotes or being limited to setups that use multiplexed control if you want the fan and light to do something different.

In the existing setup, the "back wire" hole was used in place of a pigtail and wirenut to feed power from the incoming black always-hot to the red wire that powers the fan.  So, nut the red fan-hot wire from the wall with the black wire from the dimmer and the black always-hot from the wall (with the power off at the breaker of course!), and your fan will work again.