How to write hidden notes in a LaTeX file?

Smaller text can be marked as comment with the % character. TeX ignores everything behind it till the end of the line. (You probably knew that already)

For longer text you can use the comment package to define environments which are ignored by LaTeX.

\usepackage{comment}
% ...
\begin{comment}
 This text is ignored
\end{comment}

If your notes are simple text without any special TeX macros (especially not \if... macros) then you can use \iffalse ... \fi for this

\iffalse
  This text is ignored, but should not include `if...` and `fi` macros
\fi

Of course, you can always use the standard method, placing % before each line, to convert some text into a comment. But if you have tons of comments about contents that at some time you prefer to show in the PDF (for example, in a draft to your thesis supervisor) and you want to distinguish of comments to understand the next piece of LaTeX codes or disable it, then this standard method is not enough.

Here are two approaches to easily hide/unhide another type of comments:

Hide all comments (those without %).

  1. Define in the preamble a new command (wasting imagination I thought in \comment) that simply do nothing (see the MWE). Then you can use safely comments as \comment{The boss is too stupid to understand this paragraph, write it with simple words.}

  2. Use the todonotes package with the option disable.

Unhide comments

  1. Disable the new command \comment in the preamble (with as % before) and define again to show their content (better with some different format that the body text).
  2. In todonotes package remove the option disable. Bonus advantage: a pretty to-do list.

I hope that both approaches are self-explained in this MWE:

MWE

\documentclass{article}
    \usepackage{xcolor}
    \usepackage{lipsum} % dummy text for the MWE

% Put % before of what you want disabled

% Select what to do with todonotes: 
% \usepackage[disable]{todonotes} % notes not showed
\usepackage[draft]{todonotes}   % notes showed

% Select what to do with command \comment:  
% \newcommand{\comment}[1]{}  %comment not showed
\newcommand{\comment}[1]
{\par {\bfseries \color{blue} #1 \par}} %comment showed


\begin{document}
\lipsum[1] 
\todo{This is a to do note at margin}
\lipsum[2] 
\comment{This is a simple comment between text} 
\lipsum[3]
\todo[inline]{This is a todo note inline} 
\comment{This is the end, check the to-do list}
\listoftodos
\end{document}

If I understand your question correct, use a % at the beginning of the line. The percentage sign indicates a comment, which is text that isn't typeset.

\documentclass{article}
\begin{document}
This text will be in the PDF.
% This is a comment, and will not appear.
\end{document}

To print a percentage sign in the text, use \%.