There are two ways to do it. During rescue, we were taught how to deal with a conscious or unconscious diver that we were trying to assist underwater who was puking while coming up from depth. The first urge a person has right after they finish puking is to take a giant inhale. So the key is to try to make sure they don't suck back in a mouthful of puke when they do it and aspirate it into their windpipe and lungs. If you puke through the regulator, you need to clear it before trying to inhale in case you have chunks left in it. So the way we were taught was to hold the regulator in their mouth and pop one side out and push the purge button to blow it clean before pushing it back into their mouth as soon as they finish puking.
In practice, since I was the one doing the puking, I grabbed my wife by the shoulder strap of her BC to let her control our buoyancy so I wouldn't accidently have a runaway ascent. Then I turned away from her, pulled the reg to the side of my mouth, and let go with the chum. As I felt it finishing, I pushed the purge button and stuck it back in my mouth. Of course my wife had no idea what was happening and kept trying to turn me back towards her until she saw me blowing chunks and the cloud of fish around my head. Then she was more than happy to keep me at arm's length.
The other way to do it is to keep the reg in your mouth, puke through it, then use your teeth and tongue to strain any chunks out of the first breathe you take back in. Depending on how under control you are in the conditions and whether you have a buddy there to keep you stabilized, that may be the better way in some situations.
In practice, since I was the one doing the puking, I grabbed my wife by the shoulder strap of her BC to let her control our buoyancy so I wouldn't accidently have a runaway ascent. Then I turned away from her, pulled the reg to the side of my mouth, and let go with the chum. As I felt it finishing, I pushed the purge button and stuck it back in my mouth. Of course my wife had no idea what was happening and kept trying to turn me back towards her until she saw me blowing chunks and the cloud of fish around my head. Then she was more than happy to keep me at arm's length.
The other way to do it is to keep the reg in your mouth, puke through it, then use your teeth and tongue to strain any chunks out of the first breathe you take back in. Depending on how under control you are in the conditions and whether you have a buddy there to keep you stabilized, that may be the better way in some situations.