Stomach ulcer

If you’ve had one before how did you know you had it? Also how do they treat it? I think I have one bc my stomach hurts a lot and one night a few weeks ago I woke up feeling nauseous, sat up and threw up everywhere. Then my stomach was burning and it made me very uncomfortable and it wouldn’t go away until the morning. Every since then I get pain in my stomach a lot. I drink lots of sodas it’s a very bad habit I need to break.