Piles (hemorrhoids) are often caused through straining from being constipated and can be very painful.
There are some easy methods to treat them at home. Witch Hazel can be very soothing and relieves itching and pain. It can be bought at any chemist shop and is very inexpensive. Warm baths may help and you can buy over the counter ointments; wipes may be soothing too. Some people use cold compresses and find this helpful.
If you are in a lot of pain with bleeding and find it hard to have a bowel movement you should see your doctor to see if he can recommend something. I do hope you manage to get this sorted out as it is a very unpleasant condition.