Redirecting www to non-www using .htaccess file

Not sure if I under stand what you’re saying.
But this should redirect sites from WWW to non-WWW (secured):

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [R=301,QSA,NC,L]