A 2022 shouldn't have that problem if you've already ruled out spark plugs and the air filter. Before you spend money on diagnostics, don't do what some people do: don't rev the engine in neutral thinking that keeps it running, because you're actually just masking the real symptom while you damage other stuff.
What most of the answers above point to about sensors is correct, but there's something missing: check your brake fluid first. It sounds weird, but a 2022 Corolla has a power braking system and if the fluid is low or contaminated, the vacuum sensor acts up and the idle drops. It's a 30-second check and a lot of mechanics don't even mention it. Then yeah, a dirty MAF sensor is the most common culprit in these cases, or the oxygen sensor if it's got higher mileage.
Now, if all that checks out, you need to take it to a shop with a diagnostic scanner because a 2022 Corolla has all the electronics and it's not something to be guessing about. It could be an error code stored in the computer that isn't throwing a check engine light yet. It's gonna cost you less than cleaning random sensors and you won't have it stalling out in the middle of the avenue again.