We use the «-ing» form after «stop» to indicate that an action or event is no longer continuing:
It’s stopped raining. Let’s go for a walk. (It was raining, but not anymore.)
We’ve stopped using plastic bags in supermarkets. We take our own bag with us now when we go shopping.
We use the «to-infinitive» after stop to indicate that someone stops doing something in order to do something else:
On the way to Edinburgh, we stopped to look at an old castle. (We were travelling, then we stopped our journey in order to look at the castle.)
We stopped to have something to eat.