A bunch of new routers allow you to conveniently cut off your internet at certain times for any reason. You can always build your own kill switch though. Nick Donaldson has shared a video that shows what it takes to build your own Raspberry Pi internet kill switch. This standalone device uses a Pi Zero W to monitor it and send alerts to a firewall via SSH.
A script is used to watch for the alert and turn the external interface on/off. The above video shows how it all works.