Www to non www with https

can you please give me the exact steps to install a certificate to www.