が goes after a noun and marks it as the subject: the one that is there, the one that does something, the one a description is about. You meet it first with あります and います, where it marks what is there.
For the same reason, something mentioned for the first time usually takes が, and once it is known it takes は.
When "who", "what" or "which" is the subject of a question, it takes が, and the answer keeps が on the word that replaces it. In that position a question word does not take は.
These go beyond marking what is there and who does something.
The thing you like or dislike takes が. So does the thing you want (ほしい), understand (わかります) or are good at (じょうず上手).
English makes these things objects, which pulls learners towards を.
A plain report of what is in front of you – the weather, something arriving – puts が on the subject.
To describe one part or one side of something, the whole takes は and the part takes が.
A が at the end of a clause is a different word, meaning "but".