Use in when your sentence describes something in static position inside a larger area that surrounds it. The keys are in the car. This doesn't mean in fits every time you can picture space around a place: if you're treating that place as a point or a meeting spot rather than the area something sits inside, at can be the natural choice instead. In also has non-spatial uses, such as She's dressed in black.
You're saying where someone or something is: She's waiting in the garden. Use in when the sentence describes static position inside a larger area that surrounds the person or thing, like a garden, a room, a car or a building. If you can picture the space around it and nothing is moving in or out, in fits. A larger place can still take at, though, when the sentence treats it as a point or a meeting place rather than a space: I'll wait for you at the cafe sees the cafe as a spot on the map, while I'll meet you in the cafe pictures you inside it.
You're locating something with edges around it: The keys are in the drawer. The drawer holds them, so in marks the static position. The same condition covers in the car or in the building: nothing is moving from outside to inside, it's already there.
You're describing a state or condition rather than a place: They discussed the problem in private. In here introduces the state the discussion happens in. Other states work the same way: in trouble, in a hurry, in prison. It also names appearance, as in She's dressed in black, which says what state she's in.
Contrast: your sentence describes a change, not a position. After verbs like divide, change or translate, use into: They divided the cake into two pieces, not in two pieces. This applies after those change verbs; it doesn't decide every sentence with movement, so keep in for static position.
Quick check: ask whether the sentence says where something sits or what condition it's in. The letters are in the bag passes, because the bag surrounds them. If the sentence says something is becoming something else, reach for into instead.