Press ⇧⌘. (Shift, Command and the period key) in any Finder window. Hidden files appear greyed out; press it again to hide them. The same shortcut works in Open and Save dialogs.
What macOS hides:
- Any file or folder whose name starts with a dot:
.zshrc,.git,.DS_Store. There is no Hidden attribute checkbox; the dot is the attribute. - A few system folders flagged hidden:
/bin,/etc,/tmp, and your~/Library, which is the AppData of the Mac. To reach Library without unhiding it, hold ⌥ and open Finder's Go menu.
.DS_Store is a small file Finder writes into every folder it displays, to remember icon positions and view settings. On your own disk it is harmless. On USB sticks and network shares it shows up as clutter for Windows users; Finder can be told not to write it there.