How to boot Ubuntu 18.04 into emergency and rescue mode

Systemd has nowadays become the de facto standard init system for all the major Linux distributions. Superseding SysV and upstart, it also replaced the classical way of defining system runlevels, using system targets, a special type of unit. In this tutorial we will see how to boot an Ubuntu 18.04 system into the emergency and rescue systemd targets, and what kind of environment they provide to the users.