I try not to get too hung up on names (especially for minor characters) during the first draft, as I don't want to slow myself down. However, once I have finished, I realise it reads as a cast list of my friends and family, or that I have six names beginning with the letter 'D', and I have to go back and change them all...
At some point during your writing process, I'd recommend making a list of the alphabet and filling in your character names. Then you can see at a glance if things might get confusing. It's also a good idea to read the names aloud to make sure you haven't got lots which all sound the same, and to check for unintentionally funny combinations.
I'd also recommend a quick Google seach of a character's name before you get too attached to it (especially for main characters), just to check they're not shared by a famous – or infamous – person.
To get ideas for names, you can look through books of baby names (or use one of the many baby naming websites). These often have descriptions of the name's origin and meaning, which can be helpful or, at least, interesting.
Stay alert for good names you may come across in every day life – and write them down before you forget them.
Consider your character's age and nationality, but also think about their parents. They are the ones who named the person, after all. Parents from a poor background, for example, may choose aspirational names for their children, representing the hopes they have for them.
If I'm finding it difficult to come up with an appropriate name, I research the year of the character's birth and look at the music, films, and big news stories of the time, as well as the popular baby names.
If you're writing historical fiction, then this sort of research becomes far more important, of course. You will throw your reader right out of your story with an anachronistic name.
In fantasy or science fiction, the world – and your imagination – is your oyster. Names have a function (in real life and in fiction), though; to help us easily identify and refer to different people. If you make every name in your book very long, oddly-spelled or hard to pronounce, then do be aware that you're making things difficult for your reader.
Depending on the tone and genre of your book, names can be a source of humour, too. In satirical, farcical, and children's fiction, you can use names to define character and to highlight the heroes and villains.