Paste the correpsonding command in your terminal.
To show hidden files:
# By default macOS uses the following command:
defaults write com.apple.Finder AppleShowAllFiles FALSE
To hide hidden files:
# Change the command to true to show all files.
defaults write com.apple.Finder AppleShowAllFiles TRUE