We can use the to-infinitive structure to express someone’s purpose (the reason or the aim of an action).
https://open.books4languages.com/english-a2-grammar/chapter/the-infinitive-of-purpose/