From your comments, I understand that you want to automatically break long arbitrary strings at the end of the line without hyphenation and additionally these strings should be placed inside a \hl command as provided by the soul package.
Actually, automatically break long arbitrary strings at the end of the line without hyphenation is not a big problem and has been nicely shown in this nice answer, which you could use as starting point. However, since the macros provided by the soul package do complicated things with the token lists they are fed with, we need to approach this with some caution.
The following code creates a macro \hlautosplit that breaks a string automatically at the line end without hyphenation and wraps everything in an \hl command.
\documentclass{article}
\usepackage{soul}
\ExplSyntaxOn
\tl_new:N \l_hlautosplit_hlsplitstring_tl
\NewDocumentCommand{\hlautosplit} { m } {
\tl_clear:N \l_hlautosplit_hlsplitstring_tl
\str_map_inline:nn { #1 } {
\tl_put_right:Nn \l_hlautosplit_hlsplitstring_tl { ##1 \soulomit{\hspace{0pt plus 0.1pt}} }
}
\exp_args:No \hl { \l_hlautosplit_hlsplitstring_tl }
}
\ExplSyntaxOff
\begin{document}
\hlautosplit{Loremipsumdolorsitamet,consetetursadipscingelitr,seddiamnonumyeirmodtemporinviduntutlaboreetdoloremagnaaliquyamerat,seddiamvoluptua.Atveroeosetaccusametjustoduodoloresetearebum.Stetclitakasdgubergren,noseatakimatasanctusestLoremipsumdolorsitamet}
\end{document}

What is important here is that you cannot place any \discretionary hyphenation into the argument of \hl or into any other of the macros provided by the soul package. But we don't need this here: Instead we just add a tiny space after each letter which allows TeX to break the string at any character. However, we need to mask this tiny space using \soulomit since we don't want to bother the soul mechanism with this (and it would complain if we would not mask it). Finally, we need to expand the whole token list we just created before soul sees it inside the \hl macro.
Result with \sethlcolor{yellow}:

\-. – Jasper Habicht Nov 18 '22 at 15:54seqsplitmight not work together with thesoulpackage ... – Jasper Habicht Nov 18 '22 at 21:09soulpackage. – Jasper Habicht Nov 18 '22 at 21:21