The setup process depends on the where the game was bought.
If the game was bought via the Steam store, it is automatically added to your Steam library.
Setup and start the Steam Client, double click the game in the library and follow the instructions.
If the game was purchased via GOG, it is automatically added to your GOG library.
You may either use the GOG Galaxy Client to manage your GOG games or manually download the standalone installer. All possible ways are described in the GOG Support Center.
If the game was purchased via the App Store, it can be installed directly via the App Store.
If the game was purchased via Epic Games, it is automatically added to your Epic Games library.
It can be installed via the Epic Games launcher.
Retail versions are equal to the Steam version but with a phyical installation DVD and Steam Key. The setup can be directly started from the DVD shipped with the retail version: Installing from Disc instead of Steam
Alternatively, the product key can be activated in the Steam client and installation is proceeded from the Steam Library. See below.
If the Steam product key was obtained from a 3rd party website, it can be activated in the Steam client: Activating a Product on Steam.
If the game was purchased through the Microsoft Store, it is automatically added to the game library under My games & apps on your console.