\documentclass{article}  
 \textheight19cm \textwidth12cm \parindent0mm \parskip 1ex plus2ex minus0.8ex
\begin{document}
\parindent 0mm  \parskip 5ex
Here\hspace{2cm}is a horizontal space of 2 cm
\par
\hspace{2cm}Preceding this there is a 2 cm horizontal space 
(\verb+\hspace{2cm}+); the space at the beginning of this line was effective 
because it was the start of a new paragraph 
(as well as the start of a new line).
\newline
\hspace{2cm}Preceding this there is not a 2 cm horizontal space 
(\verb+\hspace{2cm}+); the space at the beginning of this line was ignored
because it was the start of a new line (but not the start of a paragraph).
\par
\hspace*{2cm}Preceding this there is a 2 cm horizontal space 
(\verb+\hspace*{2cm}+); the "`*"' command is always effective 
(here at the start of a paragraph).
\newline
\hspace*{2cm}Preceding this there is a 2 cm horizontal space 
(\verb+\hspace*{2cm}+); the "`*"' command is always effective (here at the 
start of a new line although the line is not the start of a paragraph).

Here are the commands \verb+\quad+ and \verb+\qquad+ between numerals: 
123\quad456\qquad789.

Here is \verb+\enspace+ between numerals: 123\enspace456\enspace789.

Here is \verb+\,+ between numerals: 123\,456\,789.

left\hfill middle\hfill\hfill right

left\hfill middle\dotfill\hrulefill right

Spaces are ignored in math mode: \( 123123 123\;123\:123\,123\!123 \)

Spaces are ignored in math mode: \( 1+1 + 1\;+\;1\:+\:1\,+\,1\!+\!1 \)
\end{document}