Perhaps I am missing something obvious here, but I am a bit confused and therefore coming up with this question.
I want to change the default "Latin Modern" font to something else. At the moment, to change it to one of the built-in fonts shipped with the TeX distribution I have.
I headed over to the fonts directory located at usr/local/texlive/2021/texmf-dist/fonts on my Mac OS to see which fonts I can use (other than downloading fonts from the internet and using them).
For example, I possibly have the font "EB Garamond" installed, since I can see the following files in the above directory:
fonts/
|- opentype/public/ebgaramond/EBGaramond-Regular.otf
|- opentype/public/ebgaramond/EBGaramond-Italic.otf
|- opentype/public/ebgaramond/EBGaramond-Bold.otf
and more. Other EB Garamond files are located in the tfm directory.
Now consider the following code:
% !TEX TS-program = XeLaTeX
\documentclass[a4paper]{article}
\usepackage{fontspec}
\setmainfont{EB Garamond}
\begin{document}
Regular text. \textbf{Bold} text.
\end{document}
I compile the file with XeLaTeX and get the following message:
! Package fontspec Error: The font "EB Garamond" cannot be found.
For immediate help type H <return>.
Now if I change the above line to \setmainfont{EBGaramond-Regular.otf} then I get the following message:
LaTeX Font Warning: Font shape `TU/EBGaramond-Bold.otf(0)/b/n' undefined
(Font) using `TU/EBGaramond-Bold.otf(0)/m/n' instead on input line 9.
All I thought I was doing was following the MWE given in this answer.
Then what is wrong with my font specification?
Moreover, how can I systematically check whether this or other font is installed, and how can I (systematically) find its "family name" (EB Garamond in this instance) to be passed into the \setmainfont{THE FONT FAMILY NAME} command?

texlive-en.pdfsays to copy that.conffile to/etc/fonts/conf.d/09-texlive.conf. So which target should actually be used, that or/etc/fonts/local.conf? – murray Nov 06 '21 at 01:09