Getting WordPress out of maintenance mode

How to fix a WordPress site stuck showing "Briefly unavailable for scheduled maintenance" by deleting the .maintenance file, completing interrupted updates and clearing caches.