As many mentioned in other answers, you have to prevent the creature from walking out of the cloud.
Grappling
If you bind a person to a spot, they're unlikely to be able to move. In 5e, Grasping Vine would be really useful if you have a ranger or druid in your party would keep them from walking.
Blocking them in
If you have access to higher magic, Wall of Stone would effectively block them in; however, for a 3rd level spell, you may prefer a more accessible option, like...
Difficult terrain
If the ground is difficult to move through (especially if they can't see through the cloud), they'll have a hard time getting out before you can implement other methods. Shatter and Gust of Wind are low-level spells that would prevent them from moving out. Even easier: just use caltrops or ball bearings to make it difficult. I'm not sure a fighter who just spent several seconds vomiting could find good footing in an area covered in retch and ball bearings, which they can barely see through the stinking cloud around them.