Go to ~\AppData\Local\Docker\wsl\data and check the file size of ext4.vhdx. Right click the file and select "Copy as path". Apply these commands on cmd.
wsl --shutdown
diskpart
New cmd will open and
select vdisk file="ext4.chdx full path here with double quotes"
compact vdisk
-- or you can use optimize-vhd command
optimize-vhd -path "\AppData\Local\Docker\wsl\data\ext4.vhdx" -mode full
That’s it.