After changing Site http to https, can’t access wp login page with a digitalocean hosting

Make sure you set the site name correctly. Download your wp-config.php file via ftp, and add these lines:
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );

Notice the httpS.

Also, if you are only using Cloudflares SSL, make sure to change the setting to Flexible SSL. But if you also have your own SSL certificate on your server, set it to FULL SSL.

Make sure to clear your cache and cookies, and perhaps check if it works on another browser.