VGA monitor works with Windows but not with Ubuntu

Generally installing the proprietary Nvidia graphics driver automatically works for most systems with Nvidia graphics cards.

sudo apt update  
sudo ubuntu-drivers autoinstall     
sudo reboot  

In your case you have old hardware, so start from the bottom with the oldest proprietary Nvidia graphics driver which is nvidia-driver-390 in Ubuntu 20.04. If that doesn't work, work your way up by uninstalling the old Nvidia graphics driver version with sudo apt remove '^nvidia' && sudo reboot and installing a newer Nvidia graphics driver version.

sudo apt update  
sudo apt install nvidia-driver-390    
sudo reboot