The rule goes like this: “If the first verb happens before the second verb, use TO. If the second verb happens at the same time or before the first verb use the ending -ING with the second verb. For example: I want to go out. (First I want and then I will go out) She stopped smoking. (First she smoked and then she stopped.) He agreed to do it. (First he agreed and then he did it)”
Simple, isn’t it? However, you have to be careful as the rule does not work for the verbs suggest, pretend and fail.
Below you can see the idea in a mind map and lower you can test it in several games.