These are not usually a problem, unless you’re “edging,” that is, getting too close to the edge of orgasm—or just starting out with your recovery after masturbating very frequently. Said one veteran:
When i started nofap, it went away within a week and there is zero pain in my testicles.You are unconsciously tightening your PC muscle group.What you want to do instead is direct your focus on your perineal area. The area of your scrotum. Just direct your attention there and relax. When you are having intercourse continue directing your attention there.This will also open up a lot more pleasure. And you will not have blue balls afterwards.
I found that cool (not ice-cold) water really helped, as did taking a lukewarm bath/shower. Try to think of completely unsexy topics or focus on something else.
https://www.yourbrainonporn.com/rebooting-porn-use-faqs/what-about-blue-balls-or-lovers-nuts/