Do you suffer from or have suffered from hemorrhoids, constipation and other anorectal disease? Research shows that squatting, rather than sitting, during bowel movements makes defecation easier and more efficient with less straining.
Most of us know proper water intake & fiber intake is required to avoid Constipation but many of us do not consider the importance of bathroom posture to pass stool easily.

Picture 1

If you see in the above picture the puborectalis muscle is Completely relaxed in a squatting position (2nd diagram) Allowing easy elimination of stool from the rectum.
On the contrary puborectalis muscle does not completely relax in a sitting posture so difficulty in eliminate Process.
So start squatting!
In Ancient times, people used to squat for defecation, when you squat with your knees against your abdomen, the internal alignment of rectum is in the right position providing easy movement of the stool.
The most advisable is the placement of a small stool/step under the feet to achieve correct posture (if using a western toilet) Indian toilet (best)

Picture 2

So experts believe that squatting position is way more effective in avoiding the development of piles/ constipation.