That sounds like your iliacus, a muscle that ties into your psoas, which is one of the hip flexors. Sometimes, they’re referred to jointly as the iliopsoas. Google them.
See a massage therapist to have it worked on properly. Or you can try some self-massage followed by light stretching. Look online for recommended stretches and massages. But beware of self-massage because your intestines and – if you’re a dude – your spermatic cord and inguinal ligament are close enough that you might not want to be blindly mashing stuff in that area. It hurts to massage the area even if you’re doing it properly.
Not a doctor.