I am sorry to hear of your recent problem with painful intercourse (dyspareunia).
The causes of painful intercourse can be divided up into superficial and deep, based on where the pain is experienced.
Superficial dyspareunia may be due to inflammation or infection around the entrance to the vagina, eg thrush (candidiasis).
Very occasionally, there may be a structural abnormality that has been present since birth, causing a mechanical problem with penetration.
Occasionally superficial pain can be caused by spasm of the vaginal muscles (vaginismus). This is often related to fears of pain due to penetration based on ignorance or fantasy, which can be relieved by explanation, examination and teaching self-examination.
Deep dyspareunia may be related to inflammation of the neck of the womb or infection of the womb, Fallopian tubes and/or ovaries.
It is essential for you get examined and have your symptoms assessed. you may have a condition that requires specific treatment.
On-the-spot tests can be done for the majority of sexually transmitted diseases (STDs) and the appropriate treatment given by professionals who are used to dealing with such problems all the time.