Firstly, configure your CMS! This is the most important step. Whether you're using Wordpress, Joomla, Drupal, SilverStripe, Magento, PrestaShop... make sure you configure it to https:// FIRST.
Then, open up (or create) your .htaccess file inside /public_html/ and paste the following right at the top:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]