NPN common emitter transistor as a switch switches off as the current draw in collector falls
simulate this circuit &ndash; Schematic created using CircuitLab

Above is just one of many ways to "skin this cat".
It has the features of;
-- ground referred control input
-- switched power rail output so that you are not putting a switch in the ground connection.