What steps are necessary to safely restart a machine hosting Microsoft SQL Server?
You don't have to be fancy/worried or scared when you are restarting sql server. 

Just make sure that you dont have any long running transactions. Best is to restart sql server using console or shutdown command during a low/minimum activity period also called maintenance window to minimize impact on your business.

If you have any DR setup and you dont want to be down, then best is to failover and then restart the passive or secondary node. 

Clean Shutdown SQL Server occurs in below scenarios :


Stop sql server using Services console.
Shutting down your server
running SHUTDOWN command in SSMS


In above all situations, sql server cleanly shutsdown all its databases and then terminates the service which involves commiting or rolling back all the transactions, writing all dirty pages to disk and then writing an entry into transaction log.

Improper shutdown of sql server :


shutdown with nowait
pulling power cable from your server (if you have access).
killing sqlserver.exe from task manager
Dirve failure on which sql server binaries, exe, system databases reside or windows system drive failure .. usually C:\ drive.
overheating of the server causing it to shutdown (should rarely happen !!)


SQL Server will always try to do a clean shutdown ...unless you do something improper as stated above.

Some really good reading links on what happens behind the scenes during recovery phase : 


Understanding Logging and Recovery in SQL Server
Understanding How Restore and Recovery of Backups Work in SQL Server
Simple overview of the SQL Server Recovery Process