My general advice: For proofs that aren’t incredibly technical, you should try to understand 90% of the details. If you’re having trouble working out details, give it a bit of time, but move on if you’re spending too much* time on it. If this keeps happening, it might be worthwhile to slow down to ensure you’re actually learning more than just definitions and theorems. For me, these strategies have helped ensure I’m learning the key techniques of the field while avoiding spending too much time on technical lemmas whose proofs I’ll never need again.
In an ideal world, you’d know how to distinguish between technical lemmas that you can treat as black boxes versus key results whose proofs illustrate important ideas. But when you’re learning new math, you don’t have a clear sense of what’s important, so you sometimes have to accept that you’ll miss important things on your first pass. I typically go back to the proofs while I’m solving problems to gain inspiration, which usually helps fill in gaps, too.
*Of course, what counts as “too much” time depends on your desired pace, the difficulty of the material, your familiarity with it, etc.