When I delivered my no1, I pushed wrongly and pushed out my piles too. It was the worst time of my life because I was in so much pain after delivery and weeks following that.
With no2, I had abit of problem towards the end of my pregnancy. What I did to relieve my piles was to soak in epsom salt. It really helped. You can read more about it here http://www.livestrong.com/article/250621-how-to-use-epsom-salt-to-relieve-hemorrhoids/
Meanwhile to avoid getting piles again you can try to increase your fibre intake, drink more water, try not to strain in the toilet and do pelvic floor exercises daily.
In preparation for your next delivery, maybe you can read up more on ways to push, and maybe do some mock exercises towards later part of your pregnancy
http://www.whattoexpect.com/pregnancy/labor-and-delivery/childbirth-stages/pushing-and-delivery.aspx