It is unclear, what is your problem. More certain we can be, if you would provide an MWE (Minimal Working Example), a small but complete document. As example of it with your code fragment is:
\documentclass{beamer}
\usepackage{bm}
\begin{document}
\begin{frame}[fragile]
\frametitle{Comparison of normal and boldface math variables}
\verb+\bm+:\qquad $1_n, \bm{1}_n$\
\verb+\boldsymbol+:\qquad $1_n, \boldsymbol{1}_n$\
\verb+\mathbf+:\qquad $1_n, \mathbf{1}_n$\
%$\textbf{1}_n$ this should not be used
\end{frame}
\end{document}
which gives expected result:

1for me. In this case, the recommended approach is to use$\mathbf{1}_n$. – Sep 15 '20 at 02:20$\textbf{1}$works fine for me, the others don't result in boldface. – Jeroen Dec 11 '20 at 22:09\usepackage[T1]{fontenc}from my preamble. I guessbmandfontencdon't get along well. – Federico Poloni Jun 14 '22 at 11:34