# Cost function and minimization of error [duplicate]

In linear regression model, how can we define cost function. also after defining cost function how to minimize the error term?