Pain in stomach

Smith
So I woke up out my sleep bout 12:20am I was having pain in my top stomach and felt like I had to throw up the pain was so bad I could use the bathroom but I wonder why it happen