How do you safely change the PHP version for WordPress?

Create a complete backup and confirm that you can restore it. Update WordPress, the active theme, and supported plugins on the current PHP version first. Review their documentation for compatibility with the target version, paying special attention to older custom code and plugins that have not been maintained.
Test the change on a staging copy that uses the same server configuration as the live site. Open public pages, log in, edit content, submit forms, and complete important store or membership actions. Enable error logging during the test and inspect warnings or fatal errors even when the pages appear to work.
Change the version for the correct domain through the hosting panel. Keep the previous version available for a quick rollback and schedule the live change during a quiet period. Clear application, server, and CDN caches afterward because cached pages can hide a problem or continue showing an old error.
Monitor the PHP error log, server resource use, forms, payments, and scheduled tasks after the switch. If a critical function fails, return to the previous supported version and investigate the incompatible component. Do not leave the site on an obsolete release indefinitely; use the rollback as time to update or replace the code.