Every LaTeX document must contain the following three components. Everything else is optional (even text).
\documentclass{article}
\begin{document}
\end{document}
The first statement tells LaTeX what kind of document it is to process, as there are different style rules for different kinds of documents. We will use the article document class exclusively in this tutorial. Other possible classes include report, book, and letter.
The default font size for each class is 10 point. You can use 11
point or 12 point fonts by including this information in the
\documentclass command as \documentclass[11pt]{article}
or \documentclass[12pt]{article}. You could also use
\documentclass[10pt]{article}, but since this is the default
you don't need to type the [10pt] part.
In general, required information is included in LaTeX commands in braces {}, while optional information is included in square brackets [].
The \documentclass command must appear at the very beginning of your LaTeX document, before any other LaTeX commands, or you will get an error message.
If you have commands for LaTeX that will affect the whole
document, you should include them in the preamble, which is
what the space between the \documentclass and
\begin{document} commands is called. The body of the document,
where you include all of your text, must occur between the
\begin{document} and \end{document} commands. Any text
that comes after the \end{document} command will be ignored.