\documentclass{article}

\usepackage[automake]{glossaries}
\makeglossaries
\newglossaryentry{sample}{name={sample},description={an example}}
\begin{document}
\gls{sample}
\printglossaries
\end{document}