The scarab is the most common amulet form in Egypt across three thousand years, in faience, steatite, carnelian and glass, worn in life, given as a gift, and used as a seal with an inscription cut into the flat underside. Commemorative scarabs of Amenhotep III were issued to announce a marriage and a lion hunt, which makes them something close to a state press release.
The heart scarab is a specific and stranger object. A large scarab, usually of dark stone, was placed over the heart of the mummy and inscribed with a version of spell 30B of the Book of the Dead. The spell addresses the heart directly and asks it not to stand up as a witness against its owner in the hall of judgement, not to make an opposing statement, and not to tell the keeper of the balance anything that would weigh against him.
That is a remarkable thing to write on a funerary object. The heart was understood as the seat of thought and memory and as the organ actually weighed against the feather of Maat, and the spell is a request that a person's own memory keep quiet at the trial. It assumes that a truthful heart might convict its owner, and it proceeds anyway.
Winged scarab pectorals extend the image, placing the beetle at the centre with outstretched wings and sometimes the sun disc above, so that the object worn on the chest of a dead person shows the sun coming up.