Here's how I tackle it:
- if there's good unit tests, I immediately feel more comfortable and confident as nothing can explain the code and behaviour more than the test suit.
- if there's no Tests, but can allocate sometime to think and write tests. that's the best documentation you'll ever provide and benefit from.
- With better languages debuggers things are easier, logging to the console keeps to make me win quicker in some cases!
- Really long comments are confusing sometimes. and might make things more complicated than simple.
- Time will help you get everything. The more time you allocate to focus on the codebase you'll find yourself more familiar. If you have time, make sure you don't stress yourself and stare at it too long. take breaks do other things and come back to it once you brain is cleared.
- before you build on top: Once you understand most the ins and outs, try to burn down bugs before building on top.
finally - it is OK if you don't know 100% of the code. no one can easily know a whole code base they didn't write!