You should never need \\
or \newline
to end a line and certainly never ~\\
..
You have not provided a usable example so need to make some guesses to answer.
The form you show with \newline
after \\
would normally not be an error but would make the warning
Underfull \hbox (badness 10000) in paragraph at lines 28--29
note that badness of 10000 is infinitely bad according to TeX's measure of how bad the document is.
However in the scope of some commands such as \raggedright
the definition of \\
changes and it goes from being just infinitely bad to being an error.
! LaTeX Error: There's no line here to end.
A complete example:
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
zzzz.\\\newline
\raggedright
zzzz.\\\newline
\end{document}
This produces two warnings from the first use and an error from the second:
Underfull \hbox (badness 10000) in paragraph at lines 7--8
Underfull \hbox (badness 10000) in paragraph at lines 7--8
! LaTeX Error: There's no line here to end.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.12 zzzz.\\\newline
?