There are several ways to turn off a PS4 controller, including holding the PS button for a few moments, using the Quick Menu, ...
PS4 Safe Mode can be useful to troubleshoot issues with your console, but you might also get stuck in a Safe Mode loop.