My 1997 Mazda B4000 idles very rough and periodically dies from it, plez help on 1997 Mazda B4000

The fuel filter has been changed, also the air filter

2 answers
have compression check done...while doing a tune-up
have fuel pressure test done 1st thing