That can depend on the vehicle and on how you mess it up. It’s usually difficult to just get the counter out of sync by pressing the button too much because the window is large but some people do manage to do that. The more likely common problem is you send a code out of order. The signal looks something like this.
{header}{function}{secret code}{counter}{error check}
If you know what you’re doing you can sometimes change the {function} from something like {door unlock} to {start car} or {open trunk}. That’s something you may find interesting later. Lets just talk about the counter for now though. Let’s say the counters window is 0001 - 1000. Any counter number between 0001 and 1000 is valid to use but if you use counter 0501 every counter number before that is immediately invalid and the counter window will switch too 0502-1501. If you try to use any code with an expired counter it can lock out that remote immediately. It can also do some other strange things.
The most common fixes involve putting the key in and cycling about 6 times without starting the car. Sometimes that’s in the door, sometimes that’s in the ignition. On Ford it’s often enough to use a second key fob to enable the messed up one. Other cars have a pattern you must press on your key fob. Something like door lock, unlock, trunk. Many Kia on the other hand allows you to hit any button around 10 times on the fob. Other cars have a secret spot in the the glove compartment or under the cup holder where you must place your fob to reset it. It can be different from one car to the next and on model year to the next.
Always have a second fob if you’re going to play with this and do you research for your car and model.