が
Marks who or what does something
You’ll be able to mark the subject when identifying who or what performs an action.

電車が来ます。
densha ga kimasu.
What do you think this sentence means?
The train is coming.
Mark the grammatical subject
The particle が marks the subject: the person or thing directly connected to what follows. It is especially common when identifying who or what, introducing new information, or with certain predicates.
猫がいます。
neko ga imasu.
There is a cat.
Put が after the subject
Place が after the noun that is the subject of the verb or description.
誰が来ますか。
dare ga kimasu ka.
Who is coming?
雨が降っています。
ame ga futte imasu.
It is raining.
犬が庭で遊んでいます。
inu ga niwa de asonde imasu.
A dog is playing in the yard.
は vs が
Think of は as setting the stage (“As for X...”) and が as a spotlight pointing to the specific doer (“It is X who...”).
が, identifies the doer
誰が来ますか。
dare ga kimasu ka.
Who is coming?
が shines the spotlight on the unknown person being asked about.
は, frames the topic
田中さんは先生です。
tanaka-san wa sensei desu.
Tanaka is a teacher.
は brings Tanaka into the conversation, then tells us about him.
誰が来ますか。
dare ga kimasu ka.
Who is coming?
誰がこのケーキを作りましたか。
dare ga kono keeki o tsukurimashita ka.
Who made this cake?
子どもが牛乳を飲みました。
kodomo ga gyuunyuu o nomimashita.
A child drank milk.
13 more examples in the grammar path — free for a limited time.