Gagging off spit

So my 16 week old just had a horrible gagging experience. Pretty sure from spit. I believe he's teething. I was so nervous. Any suggestions what can help next time.