how to prove theorems

I'm a second year undergraduate math student, opposite to all my peers, I don't care about the grades i get by knowing how to solve a problem or applying a theorem, i care more about how a definition was put and how to prove theorems. Because for me, that's the definition of being a good mathematician in the future, being able to prove any theorem you encounter in your degree (at least the low level ones).

But im having a hard time proving some theorems on my own without an immense help and a lot of reminders to get through the proof, and sometimes i just can't even understand the proof of a theorem even if it was given to me (im talking especially about real analysis theorems because i find algebra ones more easy ig).

So if any of you have any kind of advice on how to get better at understanding and proving theorems, don't hesitate to tell me please.

One of the theorems that is still stuck in my head and i couldn't understand how to prove it at all is the theorem of "Density of Q in R", as much as a i read the proof of this theorem in a 1st year level, and asked AI to explain it step by step. i just can't grasp it, so if anybody would be able to cite me a proof or explaining it themselves i would be really glad thank you

Author: No-Buy5233