Even simplier now with a one-liner on Drupal 8.9 (the decode
function has been removed from the Yaml Symfony Dependency utility class) :
use Symfony\Component\Yaml\Yaml;
$ymldata = Yaml::parseFile(DRUPAL_ROOT . '/core/modules/toolbar/toolbar.breakpoints.yml');