Dialogue should advance the plot, create conflict, or reveal character. If it doesn't, then it can be cut.
Dialogue should only seem realistic, while actually being far more interesting. Truly realistic dialogue will bore the reader.
An important rule in creating interesting and realistic dialogue is that whatever one says is for them to achieve a goal. This applies to anything anyone would say, whether it's to impress, to manipulate, to anger, or anything else. A character will not say something if it doesn't help them achieve any goal of theirs.