The tocstyle
package is no longer part of MikTeX. From https://ctan.org/pkg/tocstyle:
The package has been withdrawn from the koma-script bundle in Juli 2020 and is now considered obsolete. tocbasic and scrwfile should be used instead.
If you want to use it anyway, download the content from http://svn.code.sf.net/p/koma-script/code/trunk/obsolete/tocstyle-obsolete/, unpack it and add tocstyle.sty to your documents directory.
See also: https://www.komascript.de/release3.31
Dieses Paket hat nie den Alpha-Status verlassen, war also immer nur eine Entwicklungsstudie. Es wurde auch immer davor gewarnt, dieses Paket für den produktiven Einsatz zu verwenden, da es jederzeit in seiner Funktion komplett verändert oder aus KOMA-Script entfernt werden kann. Viele Funktionen des Pakets wurden inzwischen tatsächlich in anderer Form in anderen Teilen von KOMA-Script, beispielsweise tocbasic oder scrwfile, implementiert. Das Paket ist daher ab KOMA-Script 3.31.3500 nicht mehr Teil der KOMA-Script-Sammlung. Auf CTAN wird es in das Paket KOMA-Script obsolete weiterhin verfügbar sein. Damit wird auch der Support durch mich, den es offiziell nie gab, vollends eingestellt.
Translation: This package has never left the alpha state and was always "development engineering". It has always been warned to use this package for productive environments since incompatible changes (or a complete removal) could always happen. Many features of this package are currently offered in supported packages like tocbasic
or scrwfile
. Therefore this package is not part of KOMA-Script 3.31.3500 anymore. It could still be found on CTAN, marked as obsolete, but there will be (still) no support for it.