A lot of guitarists end up frustrated and giving up because no matter how many cool riffs they learn from YouTube, they don't seem to be getting any better.
This is because things only get easier if you pick up new techniques from within the material you learn.
But if you've already mastered the core techniques, then learning songs and riffs from YouTube lessons is really useful.
I use YouTube all the time to pick up things I don't have time or inclination to work out - for example, I was helping my daughter recently as she'd been trying to learn More Than Words ( Extreme). I hadn't played that song before so I quickly watched a YouTube lesson from someone who'd already taken the time to learn all the chords. Since I already have the playing techniques mastered, I was able to play it instantly and teach my daughter quickly.
Of course, I'm very proud to say that within 15 minutes, having learned 3 new chords and a new right hand pattern, my daughter could play the whole verse - in time - and at the right tempo. I don't know where she gets that talent from ! ;)
The vocabulary of guitar techniques used by shredders is fairly wide. Most of these techniques are useful in all other styles too, like hammer-on, pull-off, sweep picking, vibrato - but the hallmarks of a rock or metal technique are things like wide-vibrato, heavy legato for speed, harmonics, right-hand tapping and a heavy, distorted guitar sound.
The best shredders all have one thing in common - they are musicians, not just guitarists. They fundamentally understand music, harmony, chords, intervals, and how to improvise.
It is too easy in the modern era to learn all your favourite guitar licks from a YouTube lesson or two. This kind of learning isn't enough to turn you into a great player, or one that can improvise and control their techniques. But it is fun to learn this way for a while.
It comes down to knowing rather than understanding. A bit like a parrot that learns to mimic a few words it hears, without understanding where it comes from, what it really means and that the word is part of a language that has different translations all over the world.
Shredding isn't easy to master, because it usually means playing very fast. So, as well as developing your right-left hand coordination and working on your timing and speed, you really have to get stuck into some music theory - scales, modes, harmony etc. It really isn't much good learning a bunch of scales if you don't know how to use them musically.
Don't be put off by the word 'theory' either - it really isn't that complicated and you don't need to learn to read music. You do need to learn about chords, harmony and Intervals. You could start, if you haven't already, by learning to play the blues like Gary Moore or Joe Bonamassa - Blues is easy for guitar and these guys mix it with a fair bit of shredding.