Sure, this is a very common request and there are already eight or nine threads in the forum about it.
You just can’t do it with anything involving smartthings. that’s because it would require custom code and all custom code runs in the cloud.
Instead, there are a number of different smart plugs sold for exactly this purpose. Most of them are Wi-Fi and ping a specific website at regular intervals. If they don’t get through to that website, then they reboot themselves. Very simple and works well.
See the following thread: