The likelihood function $L(\theta)$ provides us with both, a point estimator and a confidence set estimator for $\theta$. In particular, to make things simple, let $X_1,\ldots, X_n$ be an i.i.d. random sample from a model having pdf $f_\theta$, with $\theta\in \mathbb{R}$.
The Maximum Likelihood Estimator is defined as
$$
\hat \theta = \underset{\theta\in\Theta}{\arg \max}\, L(\theta),
$$
or, under appropriate smoothing conditions, as the solution to the likelihood equation
$$
\frac{d\ell(\theta)}{d\theta} = 0,
$$
where $\ell(\theta) = \log L(\theta)$. Under appropriate conditions, and
if $\theta$ is the true parameter, we have
\begin{align}\label{1}
\Lambda_n(\theta) = -2(\ell(\theta)-\ell(\hat\theta)) &\overset{d}\to \chi_1^2,\quad\quad\text{(*)}
\end{align}
that is to say
$$
\Lambda_n(\theta)\,\,\dot\sim\,\, \chi_1^2
$$
where the symbol "$\,\dot\sim\,$" means "asymptotically as $n\to\infty$ distributed as".
The point here is that $\Lambda_n(\theta)$ provides an asymptotic pivotal quantity, which we can use to do hypothesis testing and build confidence sets. To go straight on to the matter of your post, I'll focus here on the latter.
By definition, a confidence set of level $1-\alpha$ is a random set which traps the true value with a probability no lower than $1-\alpha$. Thus if $C_{1-\alpha}$ is some set s.t.
$$
P_{\theta}(\Lambda_n(\theta)\in C_{1-\alpha})\geq 1-\alpha,\quad\forall\theta,
$$
then the set
$$
\{\theta:\Lambda_n(\theta)\in C_{1-\alpha}\}
$$
forms a (random) confidence set with probability coverage $1-\alpha$. The set $C_{1-\alpha}$ can be determined in different ways, but the usual approach is to use the threshold $\chi_{1,1-\alpha}^2$, and look for values of $\Lambda_n(\theta)$ that are below $\chi_{1,1-\alpha}^2$. Indeed, for every fixed $\theta$,
$$
P_\theta(\Lambda_{n}(\theta) \leq \chi_{1,1-\alpha}^2)\,\, \dot=\,\, 1-\alpha
$$
where $\chi_{1,1-\alpha}^2$ is the upper $\alpha$th level quantile of the $\chi_1^2$ distributions. The usual likelihood-based confidence set is thus
$$
\{\theta:\Lambda_n(\theta)\leq \chi_{1,1-\alpha}^2\}.
$$
The R
-example below illustrates this in the case of $f_\theta$ being the Poisson distribution. In the figure, the horizontal dashed line represents the 0.95th quantile of $\chi_1^2$ distribution, and the dashed vertical lines mark the limits of the confidence set, which in this case happens to be an interval.
library(latex2exp)
# fix some observed data
y <- c(5, 4, 1, 0, 0, 1, 1, 2, 1, 1)
# the log-likelihood function
llik <- function(lambda, y){
oo = dpois(y, lambda = lambda, log = TRUE)
return(sum(oo))
}
ybar <- mean(y)
x <- seq(.1, 4, len=100)
ll <- sapply(x, function(x) llik(x,y=y))
llikv <- Vectorize(function(x) llik(x,y=y), "x")
lo <- uniroot(function(x) 2*(llik(ybar, y)-llikv(x))-qchisq(0.95, df=1),
lower = 0.1, upper = ybar)
up <- uniroot(function(x) 2*(llik(ybar, y)-llikv(x))-qchisq(0.95, df=1),
lower = ybar, upper=4)
plot(y = 2*(llik(ybar, y)-ll), x=x,
type="l", ylab=NA,
xlab = expression(theta),
xlim=c(0.1,4))
abline(v = ybar, lwd=2, lty="dotted")
mtext(TeX("$\\widehat{\\theta}$"),side=1, at=1.6,padj = 1)
abline(h = qchisq(0.95, df=1), lwd=2, lty=2, col="gray")
segments(x0=lo$root, x1=lo$root,y0=-1.5,y1=8+qchisq(0.95, df=1), lwd=2, lty=2)
segments(x0=up$root, x1=up$root,y0=-1.5,y1=8+qchisq(0.95, df=1), lwd=2, lty=2)
mtext(TeX("$\\chi_{1,.05}^2$"),
side=1,
at=3,padj = -2.5,las=1,adj=0)
mtext("95% lik. conf. set",
side=1,
at=1,padj = -4.5,las=1,adj=0)
text(x = 0.5, y=50,TeX("$2(l(\\widehat{\\theta})-l(\\theta))$"))