It's not that unusual for this to happen on a Corolla of that generation, but it's definitely not something you should ignore either. Apart from low coolant (which is the obvious one), there's a detail a lot of people don't check in time: the thermostat might be stuck or failing. If the engine is only overheating in the city with the AC on, the radiator fan might not be turning on when it should. That often happens when the thermostat isn't sending the right signal, and it's easy to overlook because people just check the fluid and call it a day.
So first thing is to check your coolant level with the engine cold (this matters - don't open anything while it's hot). If it's low, top it off and watch whether the problem comes back over the next few days of driving. If the temperature keeps climbing anyway, it's almost definitely the thermostat or the electric fan isn't working right. Another thing that can happen is the radiator getting clogged inside from buildup, especially if you haven't done cooling system maintenance in years.
Given that your car's only a couple years old, it would be weird if it was something major. But yeah, it's dangerous to keep going like this because extreme heat can damage the head gasket or cause warping in the cylinder head, and that gets expensive. Take the car to a trusted mechanic so they can diagnose whether it's the thermostat, the fan, or something else in the cooling system. Don't wait too long on this.