[verb (plain)] + こと [i-adj] + こと [na-adj] + な + こと [noun] + である + こと
こと turns a verb phrase into a noun, so it can take は, が or を and sit where a noun would: "playing the piano", "to go to Japan". It follows the plain form of the verb, and the tense of that verb stays as it is.
The phrase before こと is a full clause and can carry its own subject, marked with が or の: かれ彼がくる来ること, "his coming".
Before です and in fixed patterns such as ことができる, ことがある and ことにする, only こと works.
With verbs of seeing and hearing, and with まつ待つ and てつだう手伝う, only の works, because you perceive or help with the action as it happens.
A notice or a list of instructions can end on a dictionary form or ない-form plus こと. It means "must" or "must not", and it belongs to writing.