Here's how I did this in Drupal 10:
Place this at the top of my custom module
use Drupal\webform\Entity\WebformSubmission;
In my Controller build function:
$sub = WebformSubmission::load(2036); //need a submission id
$data = $sub->getData();
Now you have the data in an array.