The straining makes hemorrhoids swell. Follow your high-fiber diet and drink plenty of water. If necessary, take a stool softener, such as Haley's M-O, Metamucil or Citrucel, or mineral oil. Softer stools make it easier to empty the bowels and lessen pressure on the veins. Don't overuse laxatives.
Diarrhea can be as irritating to the anus as constipation.
Ask your health care provider what nonprescription product you should buy to relieve pain and itching. Also, ask about any side effects of any medications prescribed for you. Exercise regularly to help prevent constipation. Avoid a lot of wiping after a bowel movement if you have hemorrhoids. If necessary, shower instead of wiping, then dry the anus gently.