On/off switch for cpu cooling fan

I’m using a cpu fan to cool my motor. When I want to turn it on or off I have to plug and unplug the wires. Is there a way to use a switch or something else that is more convenient? The fan connector is a 4 pin Molex and the lipo battery uses a 2-pin jst plug.