Listing may fit when the house is updated, easy to show, and likely to appeal to traditional buyers. A good agent can provide broad exposure and may produce the highest gross sale price.
A direct sale may fit when the house needs work, still has belongings inside, has tenants or city issues, or comes with a deadline that makes a normal listing difficult. In those situations, the value of the sale may be as much about certainty, privacy, and avoiding more work as it is about the headline price.
Selling it yourself may fit when you already know the buyer or have the experience and time to manage pricing, marketing, access, negotiations, paperwork, and closing coordination.