Press the power button and it'll restart and restoring the windows. Press the power button for so long and it'll sleep. When return it'll restore the whole windows.
What about if I want true restart or shut down?
Press and hold the power button for several seconds and your Mac will power completely off. This should only be required in the most extreme circumstances. Normally, you should shut down your Mac by clicking on the Apple icon in the upper left corner of the menu bar and selecting
Your applications are resuming when you log back in because you're telling OS X to restore their state when you shut down.
When you shut down or log out make sure the
This will prevent OS X from saving the state of open applications and restoring them when you log back in.
You should also check your log in settings to make certain you aren't starting programs as login options. Open
First thing first, pressing the power down until it shuts off is NOT recommended unless in extreme cases as forcing the hardware to cut power may result in a corrupted disk image if there are system (or user) processes writing data out to the SSD or HDD. You'll know you have a corrupted HDD or SSD when you run Disk Utility's Verify on them.
Try Command-Space (or whatever key combination you have preset for Spotlight), and type
The Terminal.app may prompt you for an administrator password, so please type that when requested.