There are multiple ways to unfreeze a Nintendo Switch, including closing and re-opening a frozen game or resetting the console.
There are several ways to turn off your Nintendo Switch or put it into Sleep Mode, most of which involve the power button.