To upgrade/downgrade PHP version, log in to your cPanel and visit the "Select PHP Version" menu:
Then you can select which PHP version for your cPanel.
Note for upgrading to PHP 8:
Remember to backup your WP site first before upgrading. If after upgrading you see some WP code errors, it's better to move back to PHP 7.2 from cPanel => Select PHP Version menu.
Currently only few WP official plugins support PHP 8, like Yoast SEO, JetPack, etc. Most commercial plugins found on JVZoo, CodeCanyon, etc only supports PHP 7.2 (most of them are not compatible with PHP 8 yet).