The thing is, there has to be some genetic/early developmental disposition. I "got" programming the first time I tried. 5 years on I'm still fumbling my way through beginner guitar.
apart from mental abilities, programming requires typing skills.
it's easier to learn how to pick at a keyboard effectively than how to pick at a fingerboard effectively. Keep practising the guitar.
I've had to do quite a lot of DIY as a home owner but I still feel as useless and incompetent as I did years ago. The difference between DIY, though, and programming is that the average joe doesn't have to program whereas I still have to do house repairs.. :-)