Can somebody tell me what is the meaning of "się"? I don't understand it. What is its role in these lines? How can I know which words need the "się"?
Well, 'się' is a reflexive pronoun. So it works like myself/yourself/oneself etc.
But in fact, it is a lot more wider. It's understandable why "Myję się" (I wash myself) is reflexive, but many verbs are reflexive in Polish without any logic. "bać się" is among those. Generally, just treat it always as a whole "bać się" - even if its parts can be used in reverse order or you can put some other words between them.
Also, sometimes the verb with and without "się" has different meanings. Sometimes similar (Ja myję samochód = I am washing the car, vs Ja myję się = I am washing myself) and sometimes very far apart (On dużo wydaje = He spends a lot money vs Wydaje się, że... = It seems that...)
Take a look here: https://www.duolingo.com/comment/16296174