ある and いる: existence and location
Distinguish ある and いる when locating people and things. Also compare introducing something's presence with explaining the location of an already known item.
Choose the verb for the entity
As a basic rule, use いる for people and animals and ある for objects and plants. 猫がいます means there is a cat; 木があります means there is a tree. A plant being alive does not by itself call for いる.
部屋に机があります。 means 'There is a desk in the room.' 部屋に子どもがいます。 means 'There is a child in the room.' Even at the same location, the entity being described determines the basic verb choice.
What is there, or where is it?
庭に猫がいます。 introduces the presence of a cat in the garden. 猫は庭にいます。 takes the cat as the topic and explains where it is. The difference concerns the question being answered, not just word order.
'Where is the key?' is 鍵はどこにありますか。 An answer can omit the known key: 机の上にあります ('It is on the desk'). You do not need to repeat the same noun in every sentence.
Negatives and other uses
The polite negative of ある is ありません and the plain negative is ない. For いる, they are いません and いない. Compare 鍵がありません and 先生がいません while identifying what or who is absent.
時間があります means that there is time, and 明日、試験があります means that there is an exam tomorrow. ある is not limited to visible objects. For an event, its venue can be marked with で.
Check: For a tree in the garden, should you say 木がいます or 木があります?
Show the answer and why
Say 庭に木があります。 Basic existence expressions use ある for plants; the distinction is not simply that every living thing takes いる.

