The sub-section numbers in the ToC are overlapping the title.
I've attempted the solution on this post, but it doesn't work for me.
Below you will find a sample document to recreate the issue.
\documentclass[12pt]{article}
\usepackage[margin=0.5in,headheight=48pt,includeheadfoot]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[table,usenames,dvipsnames]{xcolor}
\usepackage{sectsty}
\usepackage{multirow}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage{arev}
\usepackage{pgfgantt}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{titlesec}
\usepackage{tikz}
\usepackage{outlines}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{paralist}
% define custom colors
\definecolor{primary}{HTML}{8bc34a}
\colorlet{primarylight}{primary!60!white}
\colorlet{primarylightest}{primary!10!white}
\definecolor{secondary}{HTML}{000000}
\colorlet{secondarylight}{secondary!60!white}
\colorlet{secondarylightest}{secondary!80!white}
\definecolor{tertiary}{HTML}{1a237e}
\colorlet{tertiarylight}{tertiary!60!white}
\definecolor{background}{HTML}{FFFFFF}
% define document formatting
\pagestyle{fancy}
\rhead{}
\rfoot{PROPRIETARY & CONFIDENTIAL}
\cfoot{\thepage}
\lfoot{OTHER THING}
\setlength{\parskip}{0.5em}
%\setcounter{secnumdepth}{0}
\titleformat{\section}
{\normalfont\Large\bfseries\color{primary}}{\thesection}{1em}{}[{\titlerule[0.8pt]}]
\setlength{\parindent}{0pt}
% document coloring
%\let\oldheadrule\headrule
%\renewcommand{\headrule}{\color{secondary}\oldheadrule}
\renewcommand{\headrulewidth}{0pt}
\sectionfont{\color{primary}}
\subsectionfont{\color{secondary}}
% table of contents
%\renewcommand{@pnumwidth}{2em}
\renewcommand{\arraystretch}{2.5}
\arrayrulecolor{secondarylight}
\title{broken}
\author{}
\date{March 2022}
\begin{document}
\hypertarget{toc}{}
\tableofcontents
\newpage
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\section{Introduction}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\subsection{Sub-section}
\end{document}

tocloftpackage on how to configure the size of the box that contains the section number – daleif Mar 06 '22 at 10:25