It is common to have piles/haemorrhoids during pregnancy and treatment is the same with or without pregnancy. You have to be careful with the oral medication you take, some of which have be used under doctor's supervision.
taking a sitz bath, or sitting in warm water for 15–20 minutes
applying a topical numbing ointment
taking over-the-counter anti-inflammatory medication
eating a diet high in fiber and drinking plenty of water to prevent constipation and straining during a bowel movement
using a stool softener, which makes it easier and less painful to have a bowel movement
sitting on a cushion, which may decrease the pressure on the rectum
taking antibiotics for bacterial infections