Have you tried searching this forum? Is there anything specific that does not work for you or is unclear?
EDIT: Shrink the filesystem inside the VM, which depends on the used operating system, and keep a large margin. Then shrink the virtual disk, which depends on the type of storage you use. Then resize the filesystem inside the VM again to fit the whole disk and repair the expected errors with secondary/backup GPT or MBR.