Grip the avocado in one hand, tightly enough that it’s not going to slip from your hand but no so tightly you’re squishing the flesh inside.
Using a sharp knife in your other hand cut the avocado in half, lengthwise around the pit. When you’ve cut all the way around the avocado gently twist the two halves in opposite directions and pull apart. The pit will remain stuck in one half.