Evidently you are using LuaLaTeX or XeTeX, loading fonts via fontspec. That's where the \setmainfont originates.
As @Sverre noted in comments above, the 08 and 12 variants are optical sizes. The fontspec package is very smart, and knows what to do about that (in most cases). But the syntax is special. See the fontspec package documentation regarding Optical Sizes, particularly page 26.
Also be sure that you actually have all the EBGaramond fonts installed! The TeX package may not contain all the sizes. I find it better to download the font from an external location (such as fontsquirrel) and place them in (texmf-local)/fonts/truetype/eb-garamond then update the file name database (perhaps command mktexlsr). You may also need to delete any existing luatex-cache, usually found in (texmf-var) folder.
Try this:
% !TeX TS-program = LuaLaTeX
% !TeX encoding = UTF-8
\documentclass[12pt,lettersize]{memoir} % this class defines the size commands, used below
\usepackage{fontspec} % look at its docs page 26
\setmainfont{EBGaramond12-Regular}[% get fonts from outside source, not the TeX package
UprightFeatures = { SizeFeatures = {%
{Size=-10, Font=EBGaramond08-Regular},%
{Size=10-, Font=EBGaramond12-Regular},%
}}%
]
\begin{document}
Hello, World!\par
{\small Hello, World!}\par
{\footnotesize Hello, World!}\par
{\scriptsize Hello, World!}\par
{\tiny Hello, World!}\par
\end{document}
I tested the above, and it works on my system. When you inspect the PDF (using a better reader than the one built into TeX) you will see that as the text gets small, suddenly it thickens a bit, indicating the switch to 08 optical size. And if you look at the PDF document properties, you will see that both 12 and 08 sizes are used.
EDIT: As Thérèse notes in comment below, if you get the fonts directly from Georg Duffner's site, then what you need is pre-configured. I am in the bad habit of using mix-and-match fonts for different sizes and shapes, so I use the full fontspec syntax suggested above.
12and08are different optical sizes. When installed,fontspecshould choose the correct size automatically. – Sverre Oct 26 '17 at 14:02