An objective function is a measure of how similar a prediction of a value and the actual value are. Usually, we are looking to find the set of parameters that lead to the smallest possible cost which would imply that your algorithm will perform well.