Foam earplugs are good for shooting, with some caveats. They are certainly better than no hearing protection at all, but there are definitely better options on the market. You can spend a bit more money upfront and have a higher quality form of ear protection that will last a lot longer.