How do I install a bathroom fan with its own switch?
If you're not comfortable working with electricity then hire a professional. Improper wiring and the resulting fire isn't worth saving a few bucks.

That said:

Your existing fan/light combo is likely connected using a 2-conductor cable (like 14-2)... but for two separately switched circuits you'll need three conductors (14-3) or two separate 14-2 wires.

At the gang box, one of the conductors goes to the light, and the other goes to the fan.