You can use \label
anywhere, including in the body of the text, but the thing labelled will be (roughly) the 'current labellable thing', that is the last \*section
, or the current equation or table.
If you want to label something else (what is it you're after?) then you'll have to roll your own (not trivial), and have something which, if I recall correctly, sets \@currentlabel
.
Edited, to add:
\begin{document}
\section{Hello}
Here is some text
\label{l1}
More text.
\newpage
Further text, on page 2
\label{l2}
This is section~\ref{l1} on page~\pageref{l1}.
And section~\ref{l2} on page~\pageref{l2}.
\end{document}
In both cases, the \ref
refers to section 1, though the \pageref
refers to pages 1 and 2 respectively. In both cases, the 'thing being labelled' is the section, and the text that goes in the label, and which appears in the \ref
, is the section number.
So if you want to refer to an 'arbitrary place in the text', you have to ask yourself 'what is the text that would be produced by the \ref
?'