Could be a number of things causing that. Anything replaced or changed out recently? Spark plugs changed recently - car is pretty sensitive to spark plug quality, plugs could be fouled or just plain worn out? Started after you filled up the tank - could be a bad tank of gasoline, try a different gas station to rule that out? Vacuum leaks, exhaust leaks, induction leaks can also cause funny driveability. Faulty of clogged injectors are another possibility.
Did you notice a check engine light come on when this happens? Sometimes the CEL will flash and not stay on.
Things to check:
- Spark plugs, even if you changed them recently, pull them and read the ends. Note if anything looks different from plug to plug. Note any deposits, discolorations, wet/dry, etc.
- Oil level - double check motor oil levels. Some of the 1ZZ-FE engines on the 8th gen Corollas have turned out to be notorious oil burners. Some start very suddenly, so it is a good idea to check the oil
level as often as you can (every fillup).
- throttlebody and MAF sensor, MAF can get covered by deposits, more so if you have a free-flowing filter design. Cleaning it and the throttle body can greatly improve idle quality and drivability.
- Add a bottle of decent fuel injector cleaner - something like Redline SI-2 Fuel System Cleaner is what I like to use.