Why is my car shutting off at random? Just replaced the battery and gas filter. on 1998 Nissan 200SX

When I pull up to a stop light sometimes the car wants to cut off and today when I pulled in my driveway it really did cut off. Not sure what the issue could be.

Asked by for the 1998 Nissan 200SX
when is the last time it had a full tune-up?