On a Mac you don’t need a dot in front of a name to make a file invisible. There’s a separate hidden flag that Finder respects, and I like it for the odd helper file or folder that has to sit in a visible place but that I never want to click on.
The tool is chflags. Set the flag and the item disappears from Finder windows and the Desktop. The name stays exactly as it was, so scripts and apps that point at it keep working.
chflags hidden ~/Desktop/scratch
chflags nohidden ~/Desktop/scratch
The no prefix turns any flag off again. To see which flags a file has, add -O to a long listing. A hidden item shows the word hidden in an extra column:
ls -lO ~/Desktop
A classic example runs the other way round. Your Library folder carries this flag, and chflags nohidden ~/Library makes it show up in your home folder again. If you want a whole folder tree hidden or visible, -R applies the change recursively.
My caveat: this is tidiness, not privacy. ls in Terminal still lists the file, anyone with access can still open it, and the flag is a Mac thing. Copy the file to a Linux box or a share on my Unraid server and it shows up like any other file. For anything that actually needs protecting, use permissions or an encrypted disk image.
Further reading: chflags man page (SS64), ls man page for macOS (SS64)