Existing codebases: I'm starting my first job soon and expect this'll be a challenge for me as well, since it's not covered in curriculi. My plan is to spend some time during the (short) summer break poking at http://aosabook.org/en/index.html .
Problem paying attention: It sounds like you might not be getting enough sleep. Best source of knowledge on sleep that I know is https://www.supermemo.com/en/archives1990-2015/articles/slee... .