Update to PHP 7.4 on Ubuntu 18.04 on Digital Ocean for WordPress

I kept seeing a notice on WordPress Site Health about PHP needing an update. On Ubuntu, it was showing 7.4 as the PHP version but not in WordPress.