Custom sort order of a field which is not based on calculations or alphebetization

I found this article which seems to explain a similar problem but the solution is unclear: Filtering multiple values in a field - #9 by prantika_sinha