Bathroom light switch inoperative, but fan swith okay
Old style standard switches have two screws on the right side, visible if you remove the cover plate. You don't have to remove or even loosen the switch. When the switch is OFF only one screw is hot, but when the switch is ON both are hot. If you have a voltmeter you can check for 120 V at each screw relative to a ground. If you don't have a receptacle nearby, you can get a ground by plugging an extension cord into a convenient receptacle and then using the ground in the plug end. If the switch is not making contact internally when it is turned ON, then there would be 120 V to ground (or neutral) only on one screw.

If you have a 3-way switch or one of the new powered switches, it's more complicated.