There are several ways to shut down DebianLinux machine cleanly, with the most simple probably being from the GUI environment you are using.
For the GNOME desktop enviornment there is the option to shutdown the machine which is immediately available when you click “Logout”. Choosing this should log you out of the desktop and also shut the machine down