I started writing stories when I was very young, as I think most people do, and I never worried about naming my characters. I knew that I shouldn’t use real people’s names, and I understood that this also meant not using the names of people on television or in the newspaper. I remember thinking that those names would be too easy to recognise, and it would seem like I lacked imagination. I had no concept of legal ramifications.
I had a foolproof strategy for finding good names. I just went to the nearest graveyard, and I mixed-and-matched forenames and surnames from the headstones. I carried a little notebook and a pencil for that purpose, stuffed into the pockets of my jeans. It’s amazing the things that seem reasonable when you’re a child.
There are two problems with that approach, of course. People who catch you doing it could take it the wrong way, and get upset. Also, you’re going to struggle with diversity. And thankfully it’s now unnecessary anyway. The internet wasn’t a thing yet when I was scribbling down names copied from the final resting places of strangers, but these days I can save myself a lot of trouble (and probably some strange looks from visiting mourners) by just finding names online. There are plenty of sites that let you generate lists of random names, with options for including or excluding names which are characteristic of certain countries, languages, or backgrounds. Those sites tend to be my starting points. Then you have to do some due diligence, as follows.
First, put the full name inside quotation marks and do a search for it on the web. You’ll invariably find matches, but what you want to avoid is any name that also belongs to a notable person. Avoid historical figures, sportspeople, politicians, anyone who’s the subject of a news article for any reason, and professional people in general. Social media profile matches are almost unavoidable, but as long as there’s no other external notability, you’re probably fine. Add a well-chosen middle name to make a match less likely; you can often use a random forename from one of the aforementioned online name generators as a middle name, but see the next point.
Second, if the character isn’t from your own culture, do a bit of research regarding how that character’s name should work. There are many, many other systems besides the English-language simple Forename plus Middle name(s) plus Surname(s) convention. Many countries place the family name first, or have deterministic surnames (or equivalent) based on parental names, or have pseudo-middle names following cultural conventions that can be complex. Some cultures have compound names, and some have single names without the concept of a surname. Just be aware that you can’t generalise name structure from your own background. Ideally, you’d ask someone who’s actually from the relevant culture if your proposed name sounds right or not, and if they suggest a change, then repeat the first check above with the tweaked name, and so on. Your goal is probably for the name to be unremarkable within its context.
Third, try not to have any two characters with names that look or sound alike. Try to avoid even having duplicate initials, if you can help it, because it can confuse the reader. Remember that starting to read a book is a bit like going to a dinner party and suddenly being introduced to a lot of new people within a short space of time. It’s especially important to keep all the surnames different if you’re generally referring to people via their surname (true of many genres of fiction), and you should be hesitant about any two characters sharing a forename without a very good reason.
Fourth, keep in mind that minor characters don’t necessarily need names at all, and are often better referred to by their role from the character’s perspective. Not only does it reduce confusion, but it’s also better characterisation when a particular person has a single narrative function.
Lastly, if you’re getting hung up on a character’s name and it’s blocking your progress, just substitute something else and make a note to fix it later — but here’s a word of caution: don’t wait too long to go back and put in the actual name.
No matter what nonsense you use as a temporary placeholder, you’ll get used to it quicker than you think, and it might become welded to the character’s concept in your mind. Better to avoid that eventuality if you can.