It's a big subject, but you can start with the basic principles.
은/는 is a topic marker and 이/가 subject marker,.
As the name suggests, you use 은/는 to speak about something making it the topic of your speech, so it generally marks a deeply held though or idea.
이/가 is not as closely connected to your own thought. It is often used to describe something external because it is needed rather than you wanted to express something on your own.
For example, if you're introducing yourself to someone, you'd say 저는 ... because you're talking about yourself from your own knowledge.
If you saw an accident, you'd say 사고가 났다, because you're reacting to an external event and not about your own thought.
So we can say 은/는 fits well with subjective ideas while 이/가 is more for objective, factual things.
은/는's another important function is contrasting something with others. So you might say, 나는 육식을 좋아하는데 동생은 채식을 해요, putting the two facts in contrast.
Here are some more examples.
- 인생은 아름답다 = Life is beautiful. This assert's one's opinion, a typical case of 은/는. You could also say 인생이 아름답다, but then the nuance changes to mean that your (or someone's) life happens to be beautiful, because 이/가 is more about what's really happening than an assertion.
- (Suppose you were waiting for two friend, 영철 and 영희, but 영철 showed up alone.)
야 영철아. 왔구나. 그런데 영희는 (왜 안 왔어)?
(Typical usage of drawing attention to something (영희) as opposed to the rest (영철), similar to "as for" in English).
- 오늘 내가 할 일은 동생을 돌보는 것이다 = The thing for me to do today is looking after my brother.
(The main topic is what I need to do, so 할 일 gets the topic marker. 가 in 내가 is there just to help construct the subject phrase, so it doesn't get 은/는 - generally, the subject of a sub-clause is marked with 이/가).