\documentclass{article}

\usepackage{blindtext}

\usepackage{makeidx}
\makeindex

\begin{document}

\index{foo}
\index{bar}
\index{baz}

\blindtext

\printindex

\end{document}
