It’s not possible to completely get rid of .DS_Store on your Mac’s desktop if you still want to be able to view hidden files in the Finder, but here’s a way to make .DS_Store a little less annoying.
First, right-click in the middle of the square below. A menu will appear. Then, choose ‘Copy Image’. (This will copy a transparent PNG file to your clipboard.)
This tutorial was adapted from superuser.com.