I've had fellow writers ask me about writing dialog. It seems like a lot of people struggle with it. I look forward to the dialog in my novels...because it feels like it's writing itself, as if I'm listening to a conversation as it occurs. I think I'd struggle with it if I saw it as writing dialog.
There's no secret formula for writing dialog. I have only one tip: Don't think too much about it. Listen to conversations people around you are having. Do they, like some writers feel they must, question everything they say as they say it...wondering if it sounds natural? If they do, give 'em a hug. They'll be off to the nut house soon enough and you won't see them for a very long time. It should be the same with characters. Just record.
Here's a bit of random dialog from Sexton Spice. The setting: inside the museum. The body of a fellow protector is on the floor when Barkerson walks into the room. Sistelli speaks first, and makes it plain he isn't interested in the corpse.
"Any missing statues, Barkerson?"
"Why? Sir, he..."
"Is the spitting image of one of the Americans. Think of it as dying for a cause, Barkerson. Our cause." He grinned. "More money to go around, yes?"
Barkerson smiled. His upper lip was tight against his teeth. "Unless you decide to kill me, too."
"Not a chance--we're partners," He shoved Tursek's dead leg with the toe of his boot. "Besides, you don't resemble any offworlder who should share, or take the blame for our little adventures."