Muffler problems

My car suddenly running very loudly, and I’m assuming it’s a muffler issue. How much does it cost to replace a muffler? I have 94 Mazda Miata. Also, what happens if I don’t replace it? What are the effects of a bad muffler? Thanks!