Cost function

In the cost function, why don’t we use absolute value, mod () or some other functions instead of squared error function?

We can refer to below link to learn more -
https://mccormickml.com/2014/03/04/gradient-descent-derivation/