you can use adb / fastboot / mix explorer with root… as example
-=-=-=-=-=-=-=-=-=-=-=-=-=-
# fastboot erase cache -> will not clear davlik
# reboot
-=-=-=-=-=-=-=-=-=-=-=-=-=-
# adb shell
# su system
# rm -r /data/dalvik-cache/
# rm -r /cache/
# reboot
-=-=-=-=-=-=-=-=-=-=-=-=-=-
# install magisk & mix explorer
# grant root in magisk to mix explorer
# grant root access in mix explorer -> settings - more settings - allow root
# change to /data/dalvik-cache and delete the files / directories
# change to /cache/ and delete the files / directories
# reboot