With wslconfig I didn't really understand in which folder to make the file, with what name of the folder, of the file and with what extension.
C:\Users\<UserName>\.wslconfig
The contents of the file:
[wsl2]
#Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
memory=192GB
More information:
https://learn.microsoft.com/en-us/windows/wsl/wsl-config