I spent far too long trying to work this out.
On Windows Server with IIS, most people would recommend using the Web Platform Installer (WebPI). The problem is that only certain specific versions are available. If, for example, you want to upgrade from PHP 7.4.13 to 7.4.27, WebPI cannot do it. You have to handle it manually.

TL;DR: Download the new version, compare the php.ini files, and swap the directories over.
Instructions
Download the version of PHP you want directly from PHP for Windows:
https://windows.php.net/download#php-7.4
You will usually want the Non-Thread-Safe version.
Make note of and install any dependencies, such as the Microsoft C++ Redistributable:
https://aka.ms/vs/16/release/VC_redist.x64.exe
Locate your current PHP installation directory. In my case, because I had originally installed PHP using WebPI, it was:
C:\Program Files\PHP
Extract the downloaded version next to the existing version and rename it with -new, as below.

You will want Notepad++ with the Compare add-on, or a similar text comparison tool.
Compare the current php.ini with the new php.ini-production.
Important: If you originally installed PHP using WebPI, most of the changes will be towards the end of the current php.ini, particularly around extensions. Do not miss these, as I did.
Copy across all relevant settings from the current configuration to the new php.ini-production, and make note of any newly introduced settings.
Copy and rename the new php.ini-production to php.ini within the new directory.
Shut down IIS from IIS Manager — at the server level, not just the site level.
Swap the PHP directory names around.

Start IIS again.
Acknowledgements
The post below was useful when I was working through this: