In my Latex, I am using
\usepackage{chngcntr} \counterwithin{equation}{section}
to keep track of my equation environments sectionwise but when I am labeling and then referring to the labels, it refers to the corresponding section, not the environment I wish to refer to.
Can anybody kindly mention what am I missing here, to refer to any environment specificly and independently of its section or subsection or whatever?!

\labelin the wrong place. – egreg Jul 25 '21 at 09:09