This answer provided a great solution for creating a new reference counter. I have a further idea to refer to a particular point without putting label or ref manually. This is done in package linguex for a different purpose. Let's see this code.
\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{linguex}
\newcounter{mynumber}
\newcommand{\myno}[1]{\hfill\refstepcounter{mynumber}(\arabic{mynumber})\label{#1}}
\begin{document}
\lipsum[1]
\ex. This is one example.
\lipsum[1]
\ex. This is another example.
Example \LLast illustrates abc and \Last illustrates xyz.
\section{New section}
This is my first theorem. \myno{first}\\
This is my second theorem. \myno{}\\
By \eqref{first} it is evident that bla bla bla.\\
By \eqref{} it is evident that bla bla bla.\\
\end{document}
This code will produce -
Now as the linguex package provides me commands like \Last, \LLast I want them to be for these new ref-counters. Is it possible?
This is a pseudo code made by me. It looks almost the same, but has two additional commands which should end-up in referring to the theorem-numbers in an automated way. The expected output is exactly the same like the screenshot attached.
\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{linguex}
\newcounter{mynumber}
\newcommand{\myno}{\hfill\refstepcounter{mynumber}(\arabic{mynumber})}
\begin{document}
\lipsum[1]
\ex. This is one example.
\lipsum[1]
\ex. This is another example.
Example \LLast illustrates abc and \Last illustrates xyz.
\section{New section}
This is my first theorem. \myno\\ % Note that I have no compulsory label argument here. It is automatically labelled.
This is my second theorem. \myno\\
By \NewLast it is evident that bla bla bla.\\ % Here the labels are referred.
By \NewLLast it is evident that bla bla bla.\\
\end{document}

\mynoto the counter name used inlinguexcould at a first glance give the desired result:\newcommand{\myno}[1]{\refstepcounter{ExNo}(\arabic{ExNo})\label{#1}}. – leandriis Oct 03 '19 at 16:27\themynumberas the equivalent to\lastto get the last used number, is that what you need? – David Carlisle Oct 03 '19 at 16:27\def\NewLast{\the\value{mynumber}}and\def\NewLLast{\the\numexpr\value{mynumber}-1\relax}? – David Carlisle Oct 03 '19 at 17:34