Dialogue is difficult for a number of reasons. Some people struggle with making dialogue sound realistic. Others struggle with voice. Still others (myself included) have trouble making dialogue mean something.
I recently had some of my work critiqued. I mean nit-picked. And the biggest problem with my opening scene? Sure, the dialogue was realistic, but it had nothing to do with the conflict that was happening. My two characters were talking about pretty much nothing while something important was going on. Basically, one character was unaware of anything unusual and the other was trying to keep it that way.
I really struggled with that one. To fix it, I put the two characters against each other, one on either side of an imaginary line. (That line: knowing what was going on.) Character A knew there was a ghost nearby, Character B didn't. So, how does that affect dialogue? Character B wanted to know what Character A was staring at, what made her facial expression change, why she was acting different all of a sudden. She wanted to know why Character A kept looking at an "empty" bench.
With these changes, and a few others, I was able to make the dialogue relevant to the scene. The dialogue was tied to the conflict, and was actually useful, because it built tension. That's the key to fiction, isn't it? Tension and conflict.
So, my advice? Figure out what your scene is about. What are you trying to accomplish? What is the main conflict for that particular scene? Make sure your dialogue supports your scene's purpose.
More on Dialogue