Final answer:
The purpose of a Horcrux, as explained by Professor Slughorn, is to achieve immortality by hiding a part of the soul in an object, thereby anchoring the wizard's existence to the living world even if their physical body is destroyed.
Step-by-step explanation:
According to Professor Slughorn in the Harry Potter series, the purpose of a Horcrux is Achieving Immortality. A Horcrux is a dark magical object where a dark wizard or witch has hidden a fragment of their soul in order to become immortal.
The process of creating a Horcrux involves committing a murder, which splits the creator's soul, allowing them to then encase a part of it in an object. By doing this, they tether themselves to the living world, even if their physical body is destroyed, giving them the potential to return to life through certain dark rituals or by having followers who can help restore them.