There's no one and only way to use this preposition. In your example Warszawa has the miejscownik form. It means 'in', eg. w pudełku - in the box; w Polsce - in Poland.
Still, you can use the same preposition in different contexts. So when you say: uderzyłem w ścianę (I hit against the wall), it gets a different meaning and therefore needs a different case - biernik.