Check your current WordPress PHP version
It's advisable to check which PHP version is presently running on your WordPress site before updating it. Some hosting companies will routinely upgrade PHP to the newest version for you, so you may not need to bother about this. Go to your admin panel and choose Tools > Site Health.
To find your WordPress PHP version, go to the Info tab, then the Server panel. You'll discover a plethora of information about your server here, including the PHP version. You may or may not wish to upgrade depending on your version. However, just because WordPress presently supports your current version does not guarantee it is the ideal one to utilize. As previously stated, updating to the most recent stable release is strongly advised.

Source: Themeisle
Steps to take before updating PHP version
Backup your site
Before changing your PHP version, make a complete backup of your WordPress site. If something goes wrong, you may simply restore your site to its original state. Adding the BlogVault backup plugin allows you to create a backup of your complete site in minutes. Merely connect your site to the BlogVault dashboard, and your site will be automatically backed up. It is also guaranteed to function and allows you to recover your site with a single tap.
Update WordPress
To avoid problems while updating your PHP, keep in mind that your WordPress core installation is up to date. If you use an older version of WordPress and upgrade to the current PHP version, you may encounter incompatibility concerns, rendering your site inaccessible. Navigate to your WordPress dashboard. If a new version is available, then it'll notify you. Click on the Update Now button.
Check your Plugins and Themes
We advise going to your WordPress dashboard and reviewing the list of plugins and themes you've installed. If there are any outstanding updates, we recommend that you install them first. Again, this is due to the possibility that some plugins would become incompatible with the new PHP version. We recommend first performing the PHP upgrade and then activating your plugins one by one to check that they all operate correctly.

Source: Malcare
You should disable the plugin before updating PHP if you get a warning indicating the new version is incompatible with your PHP version. You can be sure that it will cause problems on your site. We recommend that you update the plugin once you have upgraded PHP.
Updating the PHP version of your Website
There are two methods to do this: using your control panel (in this case, cPanel) or approaching your host provider.
Updating the PHP version in CPanel (or any other Control Panel)
Log in to the control panel of your hosting provider. Click on Select PHP Version under the "Software" tab.

Source: Fixrunner
The PHP version used by your web server will be displayed on the next page.

Source: Fixrunner
Choose the newest PHP version from the drop-down menu after clicking on the present PHP version.

Source: Fixrunner
Finally, choose Set as Current. You're finished!

Source: Fixrunner
Contact your Host Provider
All control panels are not built the same way. Contact your hosting company if you can't locate the option to update PHP on your dashboard. They would either do it for you or provide you with instructions on how to do it. Please contact your hosting company and request assistance.
FAQs
How to check your current WordPress PHP version?
Go to your admin panel and choose Tools > Site Health. To find your WordPress PHP version, go to the Info tab, then the Server panel.
What are the advantages of updating the PHP version of your WordPress Site?
Updating the PHP version of your site results in improved Load Speed and SEO Rankings along with improved security status.
What is the first step you must take before updating your PHP version?
Before changing your PHP version, make a complete backup of your WordPress site. If something goes wrong, you may simply restore your site to its original state.
What if you can’t change the PHP version from the Control Panel of your site?
Contact your hosting company if you can't locate the option to update PHP on your dashboard. They would either do it for you or provide you with instructions on how to do it.
Conclusion
In this article, we have extensively discussed the process of updating PHP in WordPress.
After reading about updating PHP in WordPress, are you not feeling excited to read/explore more articles on the topic of file systems? Don't worry; Coding Ninjas have you covered. To learn, see Operating System, Unix File System, File System Routing, and File Input/Output.
Refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and Algorithms, Competitive Programming, JavaScript, System Design, and many more! If you want to test your competency in coding, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio! But if you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc; you must look at the problems, interview experiences, and interview bundle for placement preparations.
Nevertheless, you may consider our paid courses to give your career an edge over others!
Do upvote our blogs if you find them helpful and engaging!
Happy Learning!