To use a Comparator<Foo> you would have to work out in which order you are going to sort Foo. You can have several Comparators<Foo>, with different sorting.
Start with pencil and paper, and eraser (when I go to lectures I carry a big eraser which looks as if it would cause real injury if I threw it at a student

and I say that eraser is their most important piece of hardware).
Write down how you ought to sort your Foo.
Remember that String and Integer already implement Comparable<String> and Comparable<Integer> and there is a Comparator<String> inside the String class ready for you to use. So you may not need Comparators there.
When you have written how to sort your Foo, covert that to code and put it in the
Comparator<T>#compare(T, T) method, in a class which implements Comparator. You can forget about the equals() method.
Pass an object of that Comparator to any sort() method you are using.