How do I remove paint and foam from fireplace brick?

Painted fireplace

Foamed fireplace