You should use in applications you need to protect the data you traffic. And only this data. Never use HTTPS for data that does not need to be protected as there is an extra cost to handle this data.
But understand that a lot needs to be protected. Remember that data can be manipulated along the way. HTTPS helps prevent them from being changed in this process without even being detected. So I’m not just talking about passwords or credit card numbers. Any information that is unacceptable that can be intercepted must be protected, even some that seem trivial. Imagine an altered address and the delivery goes to the wrong place. Even a simple age can make you show unsuitable content to people who cannot have access to it. Examples can be numerous.
HTTP is a protocol for transporting data typically between browsers and servers. Most of the things you do for web uses HTTP. And HTTPS is just a "safe" way to traffic this data. As you have read in the other question the data is trafficked encrypted.
Whenever someone does make one login in a website, it should be encrypted so the entered password would not be easily read if the data packets were captured improperly. Then you must use HTTPS.
If there are other data that should be protected, even if only to protect the privacy of those involved, it should use HTTPS.
All HTTP browsers and servers like Apache and IIS know how to handle this data traffic encrypted by the HTTPS protocol.
But not only that, you need a server-installed certificate to use the protocol correctly. This certificate must be purchased (there are free options with limitations) in a certifying authority (in English) that is recognized at least in the most used versions of browsers since they must also have a certificate to establish the communication. Those details are already in the other question.
Of course, for internal things, it is possible to generate your own certificate. It can be used for everything, but it will not be considered reliable outside of its internal use, which also needs to be configured to accept its own certificate.
The language itself does not need to know how to deal with the protocol. At least not to do trivial things. Of course, in some situations you may want to know how to deal with the protocol directly. But in general you only need to determine which protocol to use indicating when is HTTPS. So you don’t need to understand deeply how the protocol works to do the basics, you should just have your server configured correctly with a valid certificate.
Remember that if the page is HTTPS. All its content should also be.
Overall that’s it, of course there are some simplifications there. If you have more specific questions, post more specific questions.