Pain from constipation= throwing up

I have to go to the bathroom so bad I'm having pains and it's causing me to throw up! It's 2:30am and I just want to sleep!!