\documentclass[12pt,a4paper]{article}
\usepackage[margin=2cm,a4paper]{geometry}
\pagestyle{empty}
\title{psfrag Example}
\usepackage[T1]{fontenc}
\usepackage{ebgaramond}
\usepackage{newtxmath}
\usepackage{graphicx}
\usepackage{psfrag}
\begin{document}
Remember to compile your project with \LaTeX\ + dvipdfm via the Project Settings. Click on the Overleaf menu icon in the upper left, above the file list pane, and set `Compiler' to `LaTeX' to do this!
\begin{figure}[h!]
\centering
\includegraphics[width=.6\textwidth]{example}
\caption{Original EPS image}
\vskip3em
\psfrag{p1}{$p_1$}
\psfrag{p2}{$p_2$}
\psfrag{p3}{$p_3$}
\psfrag{\\tex[B][B]\{Plot of \$\\sin(t)\$ and \$\\cos(t)\$\}}{Plot of $\sin(t)$ and $\cos(t)$}
\psfrag{\\tex[t][t]\{\$t\$\}}{$t$}
\psfrag{\\tex[B][B]\{\$\\sin(t)\$, \$\\cos(t)\$\}}{$\sin(t)$, $\cos(t)$}
\psfrag{-1}{-1}
\psfrag{-0.2}{-0.2}
\psfrag{-0.4}{-0.4}
\psfrag{-0.6}{-0.6}
\psfrag{-0.8}{-0.8}
\psfrag{0}{0}
\psfrag{0.2}{0.2}
\psfrag{0.4}{0.4}
\psfrag{0.6}{0.6}
\psfrag{0.8}{0.8}
\psfrag{1}{1}
\psfrag{2}{2}
\psfrag{4}{4}
\psfrag{6}{6}
\psfrag{8}{8}
\psfrag{10}{10}
\includegraphics[width=.6\textwidth]{example}
\caption{The same EPS image with psfrag}
\end{figure}
\end{document}