How to resize/grow a VMware or Virtualbox disk

So you created a virtual machine… And after a month you notice that you run low on disk space…

If you have disk space left on your host machine you can grow the disk and then let the running guest OS resize it to the new given size.
This action requires VirtualBox to be installed.

Next is to grow the disk to the new disk size. This can be done in almost every operating system.
These are the tools I recommend (the commands are examples, use with care!):

Windows 10

Linux on Ext4

Linux on XFS

FreeBSD on UFS

FreeBSD on ZFS (19.3.9. Growing a Pool)

Optionally you can use autoexpand: