Some things that can cause is this include. Inadequate intake of fiber, sitting too long, straining to have a bowel movement. Hard stools.
If you are not 100% sure it is hemorrhoid related, it could also be anal fissures which cause pain as well. I will give you some links below to help you understand more about hemorrhoids. But I would see your doctor as well, especially since it's been 6 years. Anal sex doesn't cause hemorrhoids, but if you have them, it can irritate them.
Below are two excellent sites that explain about Hemorrhoids as well and what can cause and treatment along with prevention.
read here
read here
Hope this helps, If you need anything else please feel free to ask. If you found this helpful don’t forget to click the *accept* button!