I can pull my foreskin back easily when not erect and the frenulum does not hurt or stretch but when my penis is erect and i try to pull my foreskin back it tends to hurt and my frenulum feels like it's going to tear at any moment is there anything i can do to get it looser ?
You can stretch the frenulum manually just like you do your foreskin. That is the best course of action if the frenulum is too short to permit your foreskin to retract.
There also is a minor operation to relieve the frenulum, called frenuloplasty and another called frenectomy. One of these might be necessary, if the stretching does not work. Urologists do this.
Don’t let anyone sell you a circumcision. Circumcision is NOT necessary to treat this condition.