If a physical switch would work for the action, a toggle switch is probably the best control to use.
After the user toggles the switch on or off, we recommend that the corresponding action is immediately performed.
Choosing between toggle switch and check box
For some actions, either a toggle switch or a check box might work. To decide which control would work better, follow these tips:
Use a toggle switch for binary settings when changes become effective immediately after the user changes them.