I have a really hard time writing character dialogue.
It's one of the tougher parts of character writing. Some of the old basic standby tips:
-People rarely say exactly what they're thinking or feeling, so if you have characters do that it's going to sound like exposition. Good dialogue has to come from the characters' own perspective, so don't write it as if it's meant to tell the reader objective information.
-It sounds quite dry and "unpoetic" to write dialogue that stiffy responds exactly to what was last said. Let's set a scene. One character wants information from another but they're not being forthcoming. Written stiffly we'd have a request for the information, a straightforward denial, and then a reaction to the denial:
"Where are you going?"
"That's none of your business."
"Why do you have to be that way?!"
It's functional but it's quite boring - not just because there's very little personality in it, either, sequential responses like that just aren't interesting and don't sound cinematic -or- realistic. There are a million ways to rewrite this short scene and writing better dialogue is a matter of knowing how to approach that. One old exercise is to write an entire chain of dialogue that doesn't respond directly to the previous line at all. It sounds chaotic but can produce some interesting results. For example:
"Where are you going?"
"I was saving that wine."
"You're just like your mother."
-Remember your subtext. The bulk of communication is not about what's actually said but what's being implied. You could also do the above exercise by trying to work the entire structure - the question, the denial, the response - into subtext.
-When you're fine-tuning giving a character their own unique way of saying certain things can go a long way toward giving them some personality. That ranges from blatant and gimmicky to quite subtle, like differentiating a younger character from an older character with some word choices that make the younger sound a bit more awkward or bombastic.