This can be a complex topic.
In most cases, when working on the site, I of course develop without a security certificate.
In other words, I only worry about, bother with the security certificate when deploying to a production server. Also, keep in mind that most hosting providers will include a security certificate in their monthly fees, so in place of going out and buying a security certificate for https, check if your hosting provider already includes one.
As a FYI, one of the reasons I don't bother while developing with a security certificate is that in most cases, you can't use them. (Such security certificates require that you setup the certificate, and THEN the security provider has to be able to reach your web site to "activate" the security certificate. Hence, it rather obvious that during development, my computer is behind a firewall, and outside web sites can't possible reach my computer, and thus I can't use https anyway.
However, once you obtain the IP, and once you have the domain name pointing to that domain, then any user and that INCLUDES the security certificate provider can now reach your web site!
So, most low cost hosting plans - even one's for about $10 per month do include a certificate in such plans. Hence, the only time I needed security certificates is when the company has their own web server on site, and thus no hosting plan exists.
And keep in mind, there are a good number of free security certificate providers. In fact, for some sites, I have used the free Let's Encrypt one. They are a fantastic cert provider, and they are free, and they are a nonprfot certificate authority - 363 million web sites at last count.
Keep in mind that a email renewal is required every 3 months for the free cert, but they even have options for automating that.
You can thus read about Let's encrypt here:
And instructions for IIS can be found here:
https://www.snel.com/support/how-to-install-lets-encrypt-with-iis-on-windows-server-2019/
However, keep in mind that HOW you install + setup a security certificate will vary for EACH different hosting provider! (so, there is not ONE step by step here, but you will need a step by step FOR YOUR hosting provider you are using. However, near 100% of all providers will have documentation on how to setup + install a security cert on whatever system you are using.
Next up, once that security cert is installed + setup, then you probably should disable (turn off) http, and only allow https.
However, I tend to leave both http and https enabled, and then add a re-write rule to IIS that will re-direct all requests to https when a http request occurs.
Now, this STRONG suggests that you should install the re-write rule system for IIS. However, for some hosting systems, you can't do this.
So, if you log into your admin page for that hosting plan, there should be some documentation for how to setup https for that site and OFTEN a option to use the hosting providers security certificate.
As noted, they come down in price, used to be about $100 per year. However, with non profit organizations like Let's encrypt, you can now obtain a good security certificate for no cost.