Why Finder Hides Certain Files
macOS follows the Unix convention of hiding any file or folder whose name begins with a dot. Finder also respects the UF_HIDDEN flag, the com.apple.FinderInfo invisible bit, and a short list of hardcoded paths that stay hidden regardless of other settings.
Fastest Way to Toggle Visibility
Since macOS High Sierra, the keyboard shortcut Command-Shift-Period toggles the display of hidden items in the front Finder window. No restart or preference change is required.
Making the Change Permanent with Terminal
To keep hidden files visible after restarts, write the preference with defaults write com.apple.finder AppleShowAllFiles YES and then restart Finder using killall Finder. The setting is stored in the user preferences plist and applies globally.
Clearing the Hidden Flag and Invisible Bit
Files marked with chflags hidden appear in ls output but not in Finder. Use chflags nohidden to remove the flag. The older SetFile -a v command clears the FinderInfo invisible bit when Xcode command-line tools are installed.
Reaching Hidden System Folders
The ~/Library/ directory has been hidden by default since macOS Lion. It remains accessible via Terminal, the Finder Go menu, or any of the visibility toggles above.