You have to get a certificate from a provider which can verify you control the domain.
Once you've proved control you install the signed certificate with the secret private key on your server.
You can get certificates for free via Let's Encrypt and a bunch more CA's. It hasn't been expensive for ages, unless you want fancy corporate support.