Hi, Luis! Yours is a good question. I heard a good explanation, although a simplistic one, a few years ago that is still a good guide for me:
OOOOOOHHHH vs. OWWWWWWW.
Feeling heat in the muscles, and feeling that heat increase, and completing enough reps that you feel like two or more reps after that will make you fall over, is a good thing; just don't go past the point where you do think you are going to fall over (or drop the weight or whatever). That's the "OOOOOOHHHH". At that point, your working muscles might shake; that's good to a point, but that's the point when you want to end the set.
However, feeling sharp pain, especially in the joints (which sometimes are confused with the muscles) is never good, and can be an indicator of injury. That's the "OWWWWWW".
If you keep pushing yourself SAFELY, going out of your comfort zone and CLOSE to the point of extreme muscle fatigue or failure, you will build muscle strength and endurance. If you do it unsafely, you could set yourself up for injury.
Hope this helps!
A-jock