I can't find a way to remove only the page index of sections while keeping the page index of the subsections

• Welcome to tex.sx. The setting of section information is defined in the document class, so if anyone is to be able to help you, we need to know that. For best results, please include a complete small example, beginning with \documentclass and ending with \end{document} that demonstrates what you're getting now. Aug 16 '21 at 15:31

Assuming you're using one of the "standard" LaTeX document classes (or a document class that's based on one of the standard classes), you could employ the machinery of the tocloft package to achieve your formatting objective.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{setspace}
\setstretch{1.5}  % just for this example

\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{2} % or some higher number

\usepackage{tocloft} % modify appearance of ToC, LoF, and/or LoT
\makeatletter
% Don't show section page numbers in ToC:
\renewcommand{\cftsecpagefont}{\@gobble}
\makeatother

\begin{document}
\tableofcontents

\clearpage
\section{Dati dell'opera}
\subsection{Informazioni generali}
\subsection{Storia dell'opera}
\clearpage
\stepcounter{page}
\subsection{Studi per l'opera}

\clearpage