If I'm lucky, the right name just comes to me. If inspiration strikes, I put the name through a sort of screening process: does it make sense for the time/place the character was born, would the character's parents really pick a name like that, does it suit the character's personality, is it too close to another character's name or the name of someone I know, is the name's meaning (both literal and through association) ridiculous, sappy, or unsubtle, etc.
It's all feast or famine, too. If the above doesn't happen, I know I'm in for hours of listmaking on behindthename and weeks of waffling back and forth between my options. It sometimes helps to set the name question aside and spend more time fleshing the character out. If I do, I might get a flash of insight about the name...or I might not.
Characters are like kids. Some are harder to name than others.
It's not hard for me to name my main characters at all. When I wrote my first book (back in WIP stage), I was 13 and named them all just random names that didn't mean anything to the characters. My main good guys were Veroku (which I think I made up), Anese (ah-ness, I think I made this up too), and Frost. My main bad guy is Griffin and my waffling character is Damien. The characters grew into their names and in the case of the two made up ones, if I ever met an Anese or Veroku IRL, I'd be like "No, no you're not." because their personalities fit them like a glove and since I've never known the names before the characters, the personalities fit the names.
With my current about to be published book, I put more thought into it. With my main girl, she just came into my brain with her name attached, so she's Marietta. I don't like the name Marietta, but she is undoubtedly Marietta. Sometimes she's Mari and sometimes she's Etta. 90% of my other names are either ironic names (Pax for a bad guy even though it means peace, Alsandair for an incompetent good guy even though it means defender of man and at the same time Alexis for someone who kills indescriminately even though it means defender of man) or when they're throw away characters, the ones dying quickly, they get names that mean something to do with the character or sometimes ironic names (Cecilia is a seer, Akil means both important and pain and he dies pretty fast, Pivane means weasel and he is etc). Only one of my good guys has a name that means what he is -- Absalom Lucian Verity is the rebel leader, name means father of peace, light, and truth.
Also, all of my characters have full names, middles and last, that go with their characters Quella's middle name means "air" because she uses air magic, Soroka's means something to do with fire because she does fire, Marietta's is Lunshea -- moon fairy -- because it made me think of madness. Syrena's is Amara so her name means siren and her whole name -- Syrena Amara Melaine -- means siren (of) eternal dark.
For the new series I'm thinking about, it's all word names and numbers and stuff like that. It's futuristic and that's just how they name. So I have characters named Glacier, Fife, Tank with characters named Una, Octavius, Decimus etc.
Anyway, I'm rambling. It's all about the story and the irony for me to sum all that up.
Honestly, when I'm thinking up my main character, their name slaps me in the face, so to speak. It's just there in my mind already and if I feel the name doesn't rightly suit them, I change it to something of equal prominence. Typically, I acquaint myself with the personality of the character before I name them.
It takes me a while to find a name for a main character. I like to go through lists, use the super search tool, and skim other novels. It's extremely helpful to know my characters background before the search, otherwise it's a waste of my time. I usually get a list of names that may or may not work, and I try writing with them. Sometimes they just don't sound right, so I toss them.
This process can last for months. My main character of my main novel, Rosamunde Drowns, has been renamed at least six times. The story has been revised a lot too, and with each revision there came a name change.
It can be rather exhausting, but it's probably one of my favorite parts of character development.
I usually make very long lists of names that I like, names that I've heard before, names to honor a real-life person or character, etc. After that I'll spend hours reading over the lists and finding the name that best fits the MC.