1st download VMware Virtual machine & Metasploitable 2. The following articles may be helpful,
For VMware Pro,
https://untaggedmoron.blogspot.com/2022/05/get-latest-version-of-vmware.html
For Metasploitable 2,
https://untaggedmoron.blogspot.com/2022/05/download-metasploitable-2-from-right.html
After you download Metasploitable 2, if its a zip file from sourceforge, extract it.
Open the extracted folder and find the file – ‘metasploitable.vmx’.

Right click over it and open it with VMware.
Now you will see a new window.
Click on Power on this virtual machine.
Now you will see another window.
Click on I Copied it.
Now the Metasploitable will be installed in you VMware.
After the process, even if you close the Vmware, the Metasploitable will be saved to the virtual machine.