This one's tough to be sure of. Have to try a few things:
-Leave the exercise alone until fully healed. Do other exercises for the muscle if possible without aggrevating the injury. If that's not possible lay off any weight activity for the muscle until better.
-When you go back, ease back in with lighter weights while ensuring a thorough warmup. If the problem recurs or seems likely to, you can first try to continue the problem exercise by increasing the intensity on the muscle without using the same heavy weights. Ways to do this include higher reps, post-failure techniques like rest-pause, partials, negatives, etc., or something else, like pre-exhaust first with another exercise. Something else that can help is to do another less stressful exercise for the muscle first, to warm up the area more thorougly.
Or:
-Try doing the problem exercise using cables or machine.
Or:
-Forget that exact exercise, do variations or it or if necessary, find a completely different exercise that works.