Delete orphaned files after upgrade

Team.
Is there a way that we can automatically delete the orphaned files such as the windows temp and other windows files under C drive after successful upgrade?
We have noticed the large files with 6gb in size which contains the old window files after we executed Windows 11 21H2 upgrade.

Beware not to delete C:\Windows\Installer\ data or the next upgrade will fail as the installer looks for old .msi

Does it means that it is understandable that we can remain this files with a large space consumption? I mean the windows.old files. Or they will be automatically deleted from time?

I expect package cache (Installer folder) is managed by Windows; MS should confirm. Temp folder is usually intended for temporary file location, so cleaning it up should not harm.