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
Shut Down... from the drop down menu.
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
Reopen windows when logging back in option in the shut down window is UNCHECKED. Like this:
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
System Preferences and click on the 'Users & Groups' icon. Find your name in the user list and click on it and then click the
Login Items tab. Remove any applications you don't want to start on login from this list by selecting the application and clicking the - button at the bottom of the table. Like this:
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
into the search field. When the Terminal.app launches, type
sudo shutdown -h now
The Terminal.app may prompt you for an administrator password, so please type that when requested.