hello! of course there are some grammar rules to do that.... when you have a preposition and after it you write a verb it is going to be written with ING at the end. at least the preposition be TO... the verb is written with ING...
for example: Charles likes reading books
Charles likes to read books
Charles reads a book before going to the bed (BEFORE is the preposition)
you use ING form in continuous tenses
for example: I am looking for a job right now
she is listening to music....
besides there are some rules to write ING... depending on the verb....
Play - playing (final Y with a vowel before adding ING)
study - studing (Final Y with a consonant before omiting it and adding ING)
Have - (verbs end on E omit this letter and add ING)
some nouns use ING to be formed.....
it is a short review about ING form... i hope it can help you