Trouble setting new font in Overleaf

The original code \setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin} assumes Fontin has been installed in the operating system's font folder. However, this isn't the case on Overleaf, so you'll need to point fontspec at the OTF files by referring to their file names, rather than by their font names.

To get this to compile on Overleaf using the file structure you have in your screenshot (i.e. all font files on the top level, in the same folder as the .tex file), replace the \setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin} in the preamble with these instead:

\setmainfont[Path = ./,  %% Optional; but UPDATE this if 
                         %% your font files are in a folder
 Extension = .otf,
 UprightFont = *-Regular,
 BoldFont = *-Bold,
 ItalicFont = *-Italic,
 SmallCapsFont = *-SmallCaps]
{Fontin}

If you put the font files in a folder, remember to update the Path parameter (which actually isn't really necessary in your case if fonts are on the same path as the .tex). Note also that when using filenames like this with fontspec, you'll need to specify the fonts for the bold, italics etc explicitly: fontspec doesn't automatically "deduce" which files to use based on the filename pattern Fontin-Regular.otf, you need to tell it exactly what to use.

For reference, here's the list of OTF/TTF fonts that are available on Overleaf.