How to align vertices on X,Y,Z axis to an other vertex or position

Problem:

Sometimes you want to align a vertex, or several vertexes on X,Y or Z axis to an other vertex. But when you choose the vertexes and scale to 0 on the axis that you want, it feels like it is choosing a random line to scale them all.

Solution 1 - Align to Active Vertex:
Solution 2 - Align to 3D Cursor:

You can achieve the same result with 3D cursor too. This let's you align your vertices to different positions other than the selected vertices. So it is useful too.

This second method is useful when you want to align your vertices to some other position other than a vertex, like to some edge, to some precise point, may be to some part of a face.