How to redirect website domain name as www to non-www or non-www to www. If it’s hurt Google SEO.
Please provide simply way to do this.
Thanks.

non-www domains not hurt your website SEO. Because world most famous news blog Mashable running under non www domain. http://mashable.com . But google take www and non-www domain as different domain. But its not important for SEO. If you feel www is not suitable or compatible for your website or blog change non www to www.

If you want to change your Preferred domain open your website hosting folder.
open .htaccess file.
add the following line to change domain: www to non-www

<IfModule mod_rewrite.c>
    RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
</IfModule>

add the following line to change domain: non – www to www

<IfModule mod_rewrite.c>
    RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
</IfModule>

Note: remove example and .com instead of your domain name.

Please refer Google guide for Preferred domain.

Changing www or non www domain name can affect Social sharing’s ( Google Plus, Facebook like, Twitter tweets etc) ?

Yes its affect Google plus sharing and twitter tweets. But it not affect Facebook like or recommendations.

If you are using nginx, then use this code to redirect
non-www to www

server {
	listen	   80;
	server_name  www.example.org  example.org;
	if ($http_host = example.org) {
		rewrite  (.*)  http://www.example.org$1;
	}
	...
}

Read this document to find more details about nginx rewrite rules.

Will the redirect work if lets say I did not add CNAME record to dns? I have already chose my preferred domain in google per your guild above.

You don’t need to add any CNAME record.