
Finder hides dot-files and system locations by default. To show hidden files, open Terminal and run these two commands:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
TRUE, YES, and true all work as values. killall Finder restarts Finder so it picks up the new setting (open windows reopen automatically; nothing is lost).
Hide them again
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
No Terminal needed (macOS 10.12+)
Since Sierra you can toggle hidden files per-window: press Cmd+Shift+. (period) in Finder. Press it again to hide them. This is the quickest way when you just need to grab a .gitignore or poke around /Library — and it survives until you toggle it back, without touching any defaults.
The AppleShowAllFiles default still works on current macOS releases, so the commands above remain the way to make hidden files visible globally and permanently — Cmd+Shift+. is just a per-view toggle, while the Terminal commands change the system-wide default.