There are several ways to turn off a PS4 controller, including holding the PS button for a few moments, using the Quick Menu, and more.
If your PS4 controller won't charge, you can try swapping out the charging cable or checking the charging port.