How to separate bathroom light from fan
You don't have enough wires right now
Right now, all you have is a single hot, a neutral, and a grounding wire running from the switch box up to the fan and light.  As a result, with a plain wall switch and the existing wiring, all you can do is turn the light and fan off and on at the same time.  Splitting the two would either require replacing the existing /2 cable between the switch and the light/fan with a /3 cable, or using communicating &quot;smart&quot; switches to let you put a two-button remote at the wallbox and matching relay modules at the light and fan so they can be turned on and off by signals from the remote.  (My recommendation for this sort of &quot;spot&quot; retrofit work is Insteon gear; while seemingly pricy, it doesn't need a hub device, a cloud server, or WiFi to work, and it's much more adaptable to the realities of mains wiring installations than stuff made by IoT gadget makers.)