That’s a good question, and I think it would make a good topic on its own because I’d love to hear how other people go about debugging package installation and dependency issues, and if anybody has any good resources to share.
For me, it’s mostly a matter of paying close attention to error messages (and general package install or loading messages), and some intuition about where the likely points of failure are. I think the installation/loading messages are sort of overwhelming and cryptic for a lot of people, but if you can get used to it there’s a lot of information buried in there. The intuition I’m afraid I can’t explain — both that and feeling comfortable parsing error messages are skills that slowly built up with experience (I’ve been working in R for a long time). That’s not a very satisfying answer, and I think resources for useR education on this front could be better. I’m sure there’s a lot more I could learn!