à, de or nothing
When do you use verb+à+inf., verb+de+inf. and verb+inf. ?
- Il pense à manger le gâteau.
- Je vais arrêter de manger.
- Nous devons faire un gâteau.
Thank you in advance!
Maybe there are some themes or patterns, but I don't know them. You just have to remember which verbs are which - and you should try to pay attention when you first learn each verb if it needs à or de. Here are 2 webpages with some lists of each.
This is a great reference sheet: http://www.connectigramme.com/preposition.html/verbes-prep.html
Just a small note on your first example. "Impossible" is not a verb. That sentence is an example of an impersonal expression.
To answer your question, there is no rhyme or reason with prepositions. As answered already, you will have to learn the first verb and the preposition that goes with it.