There is the ability for you to manually download GameMaker runtimes for cases when restricted internet access or very slow speeds will cause the automatic download attempt within the IDE to have issues.
You should review your ui.log to confirm it is a download issue you have before proceeding with this guide because if your issue is actually that your runtime installation fails due to file write permissions or an overly-sensitive antivirus client on your machine, downloading the runtimes manually via this system will not change that outcome and the installation will still fail. (If that is the case, you need to follow this FAQ on setting correct file permissions and antivirus settings instead.)
Getting The Runtime .zip Files
If you navigate to https://gamemaker.io/account/runtimes (log into your GameMaker Account if you're asked to), you will see a list of your currently accessible runtimes. Something like the following:
If you click onto a runtime you will see a list of your available runtimes based on which GameMaker products you own.
You will always need the Core Runtime and also whichever platform(s) you wish to develop for.
Please note that we would always recommend you just get the latest runtime version, but it is also important that you install the matching runtime for the IDE version you have installed, otherwise you may have issues creating and building projects. (E.g., download the latest 2022.9.x runtime version if you have installed the 2022.9 IDE.)
Installing Your Runtimes
The downloads page linked-to above contains the detailed instructions on where to place the zips when they are downloaded, as the exact path you need depends on the version numbers, so see the info there!
But in short: you create a "download" folder at the correct location where your runtimes will end up and you put all of the .zip files into that new folder you made. Then you start GameMaker as normal and it will validate the .zips and extract the files/move them into place for you.
You should not attempt to open the .zip files yourself - there is no need to do this anyway, but also you might accidentally change the file signature and cause the validation to fail.
Still An Issue?
If this still fails to install your runtime, please report a bug and attach your ui.log file, which can be found in the folder %programdata%\GameMakerStudio2\ (Windows) and /Users/Shared/GameMakerStudio2/ (macOS) to our GitHub here.