The type of repair is going to depend on the issue with the firebox. These types include masonry repair and mortar joint repair. Some repairs require a professional and should not be done by homeowners.
Many of the repairs are simple, such as patching or refilling the joints. If the refractory panels are cracked or busted, these will need to be replaced fully, which is normally a job for professionals. If anything looks like it might cause the fireplace or chimney to become unstable, call a professional to do the repairs.
In order to repair the masonry, clean the brick that is crumbling. Use a patch mixture of to fill any crumbling or cracking places. Apply and allow to set according to the patch mixture's instructions. If a number of bricks are cracked or severely crumbled out and need to be replaced, calling a professional repair service is recommended due to stability and structure issues.
To replace mortar joints, chisel out the old mortar from the joints. Make sure they are clean and dust-free before trying to refill them. Once clean, mix up the refractory mortar material of choice. Mix according to the manufacturer's directions. Refill the mortar joints and allow them to cure before using the fireplace.