You have the answer in your question.Avoid constipation
and change your diet.
I am sure you must be aware of the details about hemorrhoids since you have had it for a couple of years.The first and foremost thing to keep your stools soft.
Drink plenty of water, take high fibre diet,include lots of whole fruits,spinach and vegetables,bananas etc.
Sitz bath twice a day for 10-15 minutes will be soothing.
Apart from polysporin
ointment, an ointment with lidocaine
before passing stools will reduce any painful episodes.Do not itch the area. Apply a mild steroid
ointment over the swelling twice a day.
Do some walking,avoid using plain tissues to wipe and start using baby wipes.
If all this home treatment is not working and you have episodes of bleeding while passing stool, get examined by your surgeon, as the treatment differs upon the grade of the hemorrhoid you have.
Hope this helps and wish you a fast recovery.