To use this feature, open Google Maps and go to Settings and tap on Navigation Settings where you will find Show Media Playback Controls, tap on it and a pop up will display different media apps on your phone. Among them tap on YouTube Music and tap Next. Remember that you'll need to have the YouTube Music app on your phone to use this feature.
After you've activated the feature, Maps will show you a YouTube Music icon on the right, tapping on which will allow you to Play, Rewind and Forward music from within the app.
Also, keep in mind that you will have to Install YouTube Premium to use this feature since YouTube does not allow background playback unless you have the Premium version installed.
If you already have the Premium YouTube installed on your phone and it is your go-to app for music, then this is a pretty useful feature for your commute. Since mingling with different apps while driving can be hazardous, being able to control your music straight from Google Maps is an excellent addition.
For now, YouTube Music is not accessible via Maps for Android but you can do the same with Apple Music and other music sources if you are an iOS user.