How can I add a switch to separately control a light and fan?
The easiest technique - ie one that won't require you to run a second line from the wall to the fan - is to install a remote control switch in place of the existing one.

The way that works is you disconnect the fan from the wiring, and insert a receiver unit which connects to light and fan separately, and then you replace the original switch with a control unit that talks to the receiver.  That gives you the control you desire without having to enlarge the switch box and run new wiring.  All the control elements are concealed behind the fan mounting and wall switch face plates, but still accessible.

These units can be purchased at pretty much any hardware store.

One such example.  This kind doesn't replace the existing switch but you mount the remote's base over the switch so it can't disable the fan/light.  Others actually replace the switch completely.