To show hidden files in MacOS, please follow the following steps:

  1. Open Terminal
  2. Enter the following command and press enter key defaults write com.apple.finder AppleShowAllFiles YES  
  3. Press and hold Alt / Option key and right click on the Finder icon
  4. click Relaunch

Your finder will now display all the hidden files and folders.
To disable showing hidden files, please follow the following steps:

  1. Open Terminal
  2. Enter the following command and press enter key: defaults write com.apple.finder AppleShowAllFiles NO
  3. Press and hold Alt / Option key and right click on the Finder icon
  4. click Relaunch