Make blocks of text invisible only if said so

One possibility is the multiaudience package:

\documentclass{article}

% remove comment from the following line for the long version
%\def\CurrentAudience{long}



\usepackage{multiaudience}
\SetNewAudience{long}
\begin{document}

normal text
\begin{shownto}{long}
   Text for execs
\end{shownto}
normal text 

\end{document}

You could use the ifthen package to implement this:

\documentclass{minimal}

\usepackage{ifthen}
\newboolean{somevariable}
\setboolean{somevariable}{false}

\begin{document}

\ifthenelse{\boolean{somevariable}}{Text if somevariable is true.}{Text if somevariable is false.}

\end{document}

I usually do this using new ifs:

\documentclass{article}
\newif\ifprintsolution
\printsolutiontrue
\begin{document}
Assignment.

\ifprintsolution
Solution.
\fi
\end{document}

See e.g. https://www.bersling.com/2016/05/22/programming-in-latex/