Select \(K\) random points from the dataset. These are tentative Centroids of each of the clusters we are going to form.
For every point in the dataset, calculate the distance from each of the \(K\) centroids. Assign this point to the centroid with the smallest distance.
The associated point with each centroid form a cluster! Find the mean (average) of all the points in the cluster, and set it as the new centroid of the cluster. (You get \(K\) new centroids this way)
Repeat step (2-3) for each of the points but for the new centroids.
Repeat this process till you converge to a particular cluster.