Hi,
For gateway installation, the main part is the certificate generation due to mutual authencation requirement.
We may follow this guide for the step-by-step installation.
https://myitworld.azurewebsites.net/2015/07/27/deploy-configure-scom-gateway-server/
Note: this is not from MS and just for your reference. Though it is based on 2012R2, there is no big difference among 2012R2, 2016 and 2019 for gateway installation.
Also, the official artical can be referenced.
https://learn.microsoft.com/en-us/system-center/scom/deploy-install-gateway-server?view=sc-om-2019
Hope the above information helps.
Regards,
Alex Zhu
If the response is helpful, please click "Accept Answer" and upvote it.