stop + infinitive (to + verb) is used to describe an action that ends so that another action can begin.
“James will be late today because he stopped to eat breakfast.”
“I’m really tired. Let’s stop to eat something soon.”
“Mr. Carlson stopped to make a phone call.”
“Mom is stopping to pick up a movie on her way home.”
stop + gerund (verb + ing) is used to describe an action that ends.
“James, please stop arriving late.”
“I’m going to stop eating chocolate cake.”
“Would you stop wasting time and finish the report?”
“Do not stop working. This has to be done before you can go home.”