Assuming your class is called magox.cls, you should issue, from the terminal and the work directory where you have either developed or downloaded the class, the following commands:
sudo mkdir -p /usr/local/texlive/texmf-local/tex/latex/magox
sudo cp magox.cls /usr/local/texlive/texmf-local/tex/latex/magox
sudo mktexlsr
Change magox to the actual file name, of course.
Saving the class file directly in /usr/local/texlive/texmf-local would not work, because LaTeX only looks (recursively) in /usr/local/texlive/texmf-local/tex/latex. Also mktexlsr is necessary, because otherwise the file would not be found in the cache that TeX Live maintains for reducing disk I/O.
After these operations, any document with \documentclass{magox} should work as expected.
sudo mktexlsrafter installing the file in/usr/local/texlive/texmf-local? Also, it should be saved as/usr/local/texlive/texmf-local/tex/latex/<class>/<class>.cls(where<class>stands for the file name). – egreg Nov 04 '17 at 11:34~/Library/texmf(this is theLibraryfolder in your HOMR folder, NOT the one in the root of you HD/SSD). Note: that folder is not created by the MacTeX installer. Note: you must create the structure yourself. – Herb Schulz Nov 04 '17 at 17:29