What does trouble codes P0301 and P0402 mean on a 1997 Mazda B2300?

Both powertrain codes, but you'll need a book to be certain check the library for one you can use free.. dave P0301 is Cylinder #1 misfire. P0401 is Excessive EGR Flow. Replace the spark plugs and wires and reset the light. If it comes back on then you probably need to remove and clean the throttle body and egr valve...right inside the intake manifold is a air port that runs down to the egr valve...it will be plugged with carbon...clean this port with carb cleaner and compressed air. This should fix it.