What is the best way to upgrade an existing site using this template with JomSocial to J4?
First you need to check all other extensions also support Joomla 4 with server requirements.
Here we added a simple step guide for how to migrate Joomla 3 to Joomla 4 : https://www.joomlart.com/blog/joomla-templates/how-to-migrate-joomla-3-to-joomla-4-step-by-step-tutorial
Kindly take full backup of site and update the extensions to latest version so when you move to Joomla 4 they are ready.
If site has many 3rd party extensions installed, i suggest you to try migration on a staging site.