That’s entirely on you. You can take the time to understand it before moving on to the next task. I say this with sympathy and understanding.
Many of us work on teams so we already have to deal with the majority of code being written by someone else. I’ve got code that’s more than a decade old, written by people I’ve never met.