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.”
The past perfect tense is used to describe an action (or event) that happened before another action (or event) happened. The past perfect is formed by combining the past tense of 'have' with the past participle of the verb.
Understand how to form sentences using the simple past