Thank. you for your question.
I'm sorry you have been suffering for so long and that sex is not pleasurable for you.
There are several reasons why sex can be painful. One of the commonest is a reaction called vaginismus where there is sudden involuntary contraction of the pelvic floor muscles as well as the thigh muscles preventing intercourse altogether or making it very uncomfortable indeed. Other causes can be infection leading to a spasm, some rare anatomical structures getting in the way, lack of arousal and fear of pain or pregnancy can compound it. Its possible to determine your particular reason through a detailed history and examination done by an experienced sex therapist or sensitive gynaecologist. There are several ways to manage the discomfort or overcome the fear of pain and learn to enjoy sex and intimacy. You may find reading about it is helpful but if self help doesn't work you might wish to consult a specialist to guide you.
Some helpful books are ' Becoming Orgasmic' by J Lo Picollo