Can someone explain? I just don't quite understand it.
Thanks.
Adding "の" immediately after a verb turns the verb into a noun. English does something similar with "-ing."
To swim in Japanese is 泳ぐ.
But if you want to say that you like swimming, 私は泳ぐが好きです does not make sense. That's a bit like saying "I like swim" in English. We want to say "I like swimming/I like to swim."
So you add の after 泳ぐ and now you have 泳ぐの.
泳ぐ = the verb "to swim."
泳ぐの = the noun "swimming."
"I like swimming" in Japanese is "私は泳ぐのが好きです."
Genki also mentions in your screenshot that if the thing you're talking about is already a noun and not a verb, you do not need の. For example, "猫が好きです" is "I like cats."