Every Mac comes with an application called Software Update, which automatically check for, download and install any available software updates. The application will prompt you to restart your Mac if necessary.
Although the automation of software update and restart is convenient most of the time, it can be quite an annoyance when you are in the midst of works, where the reminder window keeps popping up.
To avoid this annoying pop-up, you can run software update in Terminal (command line) and restart your Mac as you wish, using the following command:
sudo softwareupdate -i -a
This is also convenient for managing software update remotely over slow Internet connection. Logging in via ssh instead of remote desktop will reduce the high bandwidth requirement and yet still get the job done.