How to install and use Monit on Ubuntu/Debian Linux server as process supervision tool

Monit is a free and open source software that acts as process supervision. It comes with the ability to restart services which have failed. How do I install and configure monit to restart services such as Nginx/Apache/OpenVPN server when failed on Debian or Ubuntu Linux?