I am a LaTeX beginner writing on a report using overleaf. I have a main.tex and a refs.bib. I wanted to change the fonts of the text and sections so I added fontspec and titlesec. At first it worked but now I get the following error:
/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty:28:
Fatal fontspec error: "cannot-use-pdftex"
!
! The fontspec package requires either XeTeX or LuaTeX.
!
! You must change your typesetting engine to, e.g., "xelatex" or
! "lualatex"instead of plain "latex" or "pdflatex".
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.28 \msg_fatal:nn {fontspec} {cannot-use-pdftex}
How do I solve this? I would prefer a solution on overleaf.