May Allah Ta’ala accept your concern and effort to abstain from the sin of Zina (adultery).
Allah Ta’ala mentions in the Quraan-e-Majeed:
وَالَّذِينَ هُمْ لِفُرُوجِهِمْ حَافِظُونَ إِلَّا عَلَى أَزْوَاجِهِمْ أَوْ مَا مَلَكَتْ أَيْمَانُهُمْ فَإِنَّهُمْ غَيْرُ مَلُومِينَ فَمَنِ ابْتَغَى وَرَاءَ ذَلِكَ فَأُولَئِكَ هُمُ الْعَادُونَ
Translation: And those who safeguard their private organs (from adultery, fornication and other illicit sexual acts) except when it comes to their spouses and the bondswomen whom they own. They will surely not be blamed about (cohabiting with) them. Whoever seeks more then this (by fulfilling their sexual desires in a manner that the Shari’ah forbids), then such persons are transgressors (sinners) indeed.
Only two permissible avenues for the gratification of sexual desires have been stipulated in the aforementioned Ayaat viz. a spouse and a female slave.
Masturbation is not a permissible means of subduing the carnal desires.
It is our recommendation that a second opinion be sought, from an upright Muslim doctor, with regard to the pain being experienced and the treatment thereof.
With regard to the quelling of desires, Nabi H has mentioned: “And whoever cannot (marry) should fast, for it is a means of reducing the sexual desire.” Additionally, lower the gaze from any non-Mahram women and abstain from anything which might exacerbate the sexual desires.
Remain steadfast on obedience to the commands of Allah Ta’ala, refrain from sin and continue beseeching from Allah Ta’ala to grant you a pious and suitable spouse. Make it a regular practice to recite the following Duas:
رَبَّنَا هَبْ لَنَا مِنْ أَزْوَاجِنَا وَذُرِّيَّاتِنَا قُرَّةَ أَعْيُنٍ وَاجْعَلْنَا لِلْمُتَّقِينَ إِمَامًا
Translation: O Our Rabb! Bestow on us from our wives and our offspring who will be the comfort of our eyes, and make us leaders for the pious.
رَبِّ إِنّى لِما أَنزَلتَ إِلَىَّ مِن خَيرٍ فَقيرٌ
Translation: O My Rabb! Truly I am in need of whatever good You bestow on me
In conclusion, you should make an effort to find a pious woman so that you can lead a healthy life physically and spiritually. In the interim, you should resort to fasting and you should seek some medical help to relieve your pain.