You can run the following script and populate subscription id, name of the resource group where VNet is placed, and virtual network name:
$scriptUrlBase = 'https://raw.githubusercontent.com/Microsoft/sql-server-samples/master/samples/manage/azure-sql-db-managed-instance/attach-vpn-gateway'
$parameters = @{
subscriptionId = '<subscription id>'
resourceGroupName = '<resource group name>'
virtualNetworkName = '<virtual network name>'
certificateNamePrefix = '<name prefix of the automatically generated certificate>'
}
Invoke-Command -ScriptBlock ([Scriptblock]::Create((iwr ($scriptUrlBase+'/attachVPNGateway.ps1?t='+ [DateTime]::Now.Ticks)).Content)) -ArgumentList $parameters, $scriptUrlBase
This script will create certificate that will be used to connect to VNet. Then you need to find a Gateway, download and install VPN client and connect to the VNet. Then you will be able to connect to instance from your computer.
If you open the details of the instance in Azure portal you will see pre-populated values in Quick-start section.
See https://learn.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-configure-p2s for more details.