You can't generally tap a 3-way complex like that.
That is a 3-way switch. It's partner to another 3-way switch in a different location. Further, it is on a "spur", meaning the only wires that are here are 2 travelers (red and black) and a hot wire (presumably always-hot).
Given that it is hot, the white wire must be re-marked with tape, paint or sleeving to indicate that. Typically black is used, but other legal hot colors are allowed. The two traveler wires, it's my advice to mark those both yellow since they go on brass screws. Markings should be done the same at both ends of the cable.
Anyway, since you want the switch to control a fan, you will need switched-hot and neutral. You don't have either one of those here.
Possibly: Flip it around
It really depends what the wiring is in the other 3-way box. It might be possible to reallocate the wires so that the white wire becomes a neutral, the red and black remain travelers (remarked yellow), and then you feed the fan onward from this box. White would become neutral and switched-hot would be the "common" (black) screw on the 3-way.
You'd need some help with this at your skill level.
Hail-mary play: rearrange the entire 3-way circuit to be smart switches - only if other things are also true
Nowadays, there are "smart switches". In some cases, they allow you to rearrange how the existing wiring is used. This may allow you to get the wires you need here. We'd need more info about the other switch box and whatever else they connect to.