There is an approach to anything, any problem within reason could be solved with the right approach. This is no difference in music; whether you are struggling with a guitar solo or a difficult chordal passage or a finger twisting piano pattern. There is a way to approach to difficult sections of songs. Solving these problems is very simple. I will tell you a method I use which has worked for me for years.
When I approach difficult sections of songs, I get excited because I know that I am getting better by working it out! I like to isolate the hard section and first off understand the rhythm of the pattern. Afterwards, I add the notes. Playing the pattern isolated slowly and usually with a metronome gets me to ingrain the pattern in my head and under my fingers. I would work it up to about 80-90% of the required speed. By that time, I get familiar with that pattern.
The next phase involves working the difficult sections of songs that come before and after the harder section. This could be a bar or two before and after the hard section. The reason to why I do this is so that I feel comfortable playing into the hard section and playing out of it. This further ensures smooth transitions between all the sections. Eventually, I work it up to 100% speed, and by that time I know the piece or whatever it is I am working on.
My final words on this, don’t be scared or discouraged. Some musical phrases or passages could take some time to really master the most important thing. That crucial thing states that every practice session you work drives you towards your goal. After some time, when achieve it, I guarantee you that you will feel accomplished and gratified by your efforts.