1
My doctor told me to stop to smoke.
My doctor told me to stop smoking.
Use stop + -ing when someone finishes or no longer continues an activity: ‘He stopped smoking.’ ‘Please stop making that noise.’
2
We were tired, so we stopped having a coffee.
We were tired, so we stopped to have a coffee.
Use stop + to-infinitive when someone stops one activity in order to do something else: ‘We stopped to have a coffee.’ This means that we stopped travelling or walking and then had a coffee.
Check our grammar lesson on the difference between stop + to-infinitive and stop + -ing.