I'd probably recommend starting with the built-in YouTube controls. But for the sake of completeness here's another workflow that makes use of 3rd party software called a "phrase trainer" or "slow downer". Here's a list of them.
Typically, you'd download or otherwise record the audio from the video so that you have it locally. There are a lot of services that will let you download the audio from a YouTube video, but personally I like the command-line youtube-dl package because it works well for most popular video sites and can do audio or video.
Once you have the audio file, then the phrase trainer software will let you slow down the audio without changing the pitch, loop sections, transpose/tune, and other features that are useful for transcribing.
If you absolutely need the video as well, I know Transcribe! at least works with videos as well. So you could download the video file and it will provide the same transcribing tools for the audio but also show the video at the same time:
I find youtube-dl, Transcribe!, and MuseScore (if I need to actually write it down) to be a pretty good workflow. But it depends on your needs. For instance Transcribe! doesn't offer any kind notation feature so you'll either have to remember it or write it down somewhere else.
Some software, for instance Capo, provides built-in guitar tabbing by letting you click on the spectrogram view to add a note to the tab view. So you can then later look at what you tabbed to refresh your memory. Again, it depends on your instrument and the features that you need.