Sep 23, 2022 learning LaTeX Mac
# most of the time, these are all you need:
brew install basictex
sudo tlmgr install collection-fontsrecommended latexmk
# now try to compile your project using latexmk:
cd /path/to/your/LaTeX/project
latexmk
# if some.sty is missing,
# use the following command to find out which package includes it
tlmgr search --global --file some.sty
# and then install it
tlmgr install missingPackage
Further explanation: MacTeX is large (~4 GB). BasicTeX is a much smaller option that provides basic functionality of LaTeX. However, BasicTeX does not include latexmk and some common fonts. Fortunately, the tlmgr command is provided in BasicTeX. One can use tlmgr to find and install missing packages.
A similar package TinyTeX works well for Windows.
Activities mentions in this site have been supported by the following grants: