generally こと is for writing.
You can only use こと when:
-When there are two nouns in a sentence (before です、だ、じゃない(です)
-it’s already in the grammar construction (e.g ことができる、ことがある)
-When you say “It’s important/necessary to~”
-When you say “I have decided to do~” (ことに決める)
You can only use の when:
-Using verbs of perception (Hear, see, feel, notice, etc)
-When you say “Help (someone) to do (something)”
-When you say “Wait for (someone) to so (something)”
-When you say “Stopped (someone) doing (something)”
-When you say “Forgot to do (x)”
Footer