It depends whether you want to place an explicit command in that one place or use a setting that is generally applicable. As you didn't supply an example I borrowed one from the other answer, to show various possibilities.
the main choice to make is whether to stretch white space to compensate, or whetehr to break the line and leave it short.
\documentclass{scrartcl}
\usepackage[margin=15mm]{geometry}
\begin{document}
\def\test#1{%
Test test test test. Test test test test. Test test test test. Test test test test. Test test test #1{Supercalifragilisticexpialidocious} test. Test test test test.
Test test test test. Test test test test. Test test test test. Test test test test. Test test test test. #1{Supercalifragilisticexpialidocious} test test test test.
Test test test test. Test test test test. Test test test test. Test test test test. Test test test test. Test #1{Supercalifragilisticexpialidocious} test test test.
Test test test test. Test test test test. Test test test test. Test test test test. Test test test test. Test test #1{Supercalifragilisticexpialidocious} test test.
Test test test test. Test test test test. Test test test test. Test test test test. Test test test test. Test test test #1{Supercalifragilisticexpialidocious} test.
}
\test\texttt
\bigskip\hrule\bigskip
\begin{sloppypar}
\test\texttt
\end{sloppypar}
\bigskip\hrule\bigskip
{\setlength\emergencystretch{3cm}
\test\texttt
}
\bigskip\hrule\bigskip
\test{\hskip 0pt plus 3pt \penalty0 \hskip 0pt plus -3pt \texttt}
\end{document}