The transition of a site from HTTP to HTTPS is the next step after purchasing a certificate, an important step to improve Google's ranking, and to instill greater trust in its visitors and customers.
If you access your site via the HTTPS protocol and it happens that the lock turns green only for a few seconds, then everything returns to gray, it means that it is a problem of "mixed content", that is, of mixed https and http content in the pages of the site, such as internal images and links.
Some browsers such as FIREFOX allow you to see in detail which are the unsafe http links thus facilitating their correction.
Browsers do not like this situation because an http link in an https site is insecure and they warn you, denying you the green lock of a secure site. to solve it, you need to change the internal links of the site (and only the internal ones, which point to the same site) in the database from http: // to https: //.
You can work directly in the database, doing a search and replace, but you have to pay close attention to the serialized fields that could create problems, or consult the documentation of your CMS or e-commerce platform which usually give precise instructions on how to proceed, some products they also have a specific plugin that manages the transition to https.
Once all the HTTP links have been corrected and the site is navigable in HTTPS with the green padlock present, then you can move on to the next step, that is to force visitors to use the https version and not the http.
To do this, the .htaccess file is usually used by inserting the specific redirect instructions to https but once again I suggest you consult the documentation of the product you are using (WP, JOOMLA, etc)
A simple method is to create / modify the .htaccess file in the site root as follows:
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
Once you have been forced to use the secure protocol, you will begin to take advantage of the many advantages that this protocol offers.