If you have a brick or masonry wall, you need about three 1/2" rebar
pieces long enough to go 3" into the wall and another 3 to 5" into beam. The length
depends on size of beam. A rule of thumb is to have the rebar penetrate 2/3 the width of the beam.
Drill holes into the masonry and cement the rebar into place with a bolt anchor mix or epoxy. Allow sufficient set time between
If it is a framed wall, drill into studs for 1/2-13 threaded rod (aka "all-thread") Drill size is 7/16. Screw into holes by gripping with vise grip pliers, then proceed.
Drill corresponding holes into back of mantle and apply construction adhesive (like Liquid Nails) to the rebar and in the holes. Guide mantel onto pins and slide against wall.
Brackets, if any, may be glued into place with construction adhesive and
then toe-nailed into beam with small finish nails. Set nails below
surface with nailset and fill with appropriate colored wood filler.