Single Transferable Vote (STV) is a voting system where voters rank candidates, and generally results in fairer outcomes than traditional First Past the Post (FPP). If you like cartoon animal videos, there’s one that provides a nice overview:
There are a number of ways of counting STV ballots. In New Zealand we use a system devised by Meek in 1969 and enshrined in the Local Electoral Act 2001. For more detail, have a read of the Wikipedia article or a blogpost I wrote a couple of years ago.