Dictionary form + こと turns a verb into a noun: 趣味は 音楽を 聞く ことです.
わたしの しゅみは おんがくを きく ことです。
My hobby is listening to music.
A verb cannot stand directly before です, so こと turns it into a noun (“the act of …”). It is the same こと as in ことが できます.
Adding の to a plain verb makes the whole clause behave like a noun, so it can take が, は or を. こと does a similar job with a different flavour.
Also known asno nominalizerkoto nominalizerの ことnominalization japanese
Dictionary form + こと turns a verb into a noun: 趣味は 音楽を 聞く ことです.
わたしの しゅみは おんがくを きく ことです。
My hobby is listening to music.
A verb cannot stand directly before です, so こと turns it into a noun (“the act of …”). It is the same こと as in ことが できます.
In the textbooksMinna I, lesson 18
の turns a verb phrase into a noun: 弾くのが 好き = “like playing”.
わたしは ピアノを ひくのが すきです。
I like playing the piano.
Dictionary form + の makes the clause a noun, which can take が (好き, 上手, 見える), は or を. With 好き/上手 etc., use のが.
In the textbooksMinna II, lesson 38
〜のを 忘れました = “forgot to (do)”.
ぎゅうにゅうを かうのを わすれました。
I forgot to buy milk.
The nominalized clause becomes the object (を) of 忘れる, 知っている, 手伝う, etc.: レポートを 出すのを 忘れました.
In the textbooksMinna II, lesson 38