It's somewhat understandable, especially if they are first time players. It's still possible in 5e to make a very effective or a very useless character if you make the wrong choices. And understanding those choices can only come from playing the game and seeing the rules in action (and learning what mechanics are prominent in your DMing style). 5e does have the "quick build" sections for each class, which should lead to a fairly well-rounded character.
Give them pre-made characters
This is a bit of work, but does solve the issue. Prepare some characters, this can be as many as you have players, or it can be more to give them choice, or it can be less if you have players that are comfortable making characters. Let them pick one, and change whatever details they like, such as background (it helps to keep a record of what trait gives what bonuses to make the customization less confusing, eg. for a race like half-elf what abilities you chose for the +1).
The good news is that making characters in bulk has some serious scale effects that help you out. The first one always takes time, but once you've both refreshed your memory on the process, and gotten into the "character creation" mindset, all other characters are much easier to make.
Guide them through creation
I usually have a process like the following:
- Ask the other players what they will make, and try to figure out what their role will be (tank, damage dealer, offensive caster, healer, face, skill monkey and so on).
- Ask the DM what sort of campaign it will be and try to figure out what roles are needed (a party without a stealthy scout may be okay in some campaigns but not others).
- Pick a role for my character. Usually this comes down to thinking 2-3 things that I'd enjoy doing a lot.
- Pick a class. The above should have narrowed down my choices a lot already. At this point I also tend to decide roughly on specialization (such as main weapon or spell type).
- Roll abilities.
- Decide which race works best based on the above.
- Come up with some kind of backstory and personality for my character.
- Decide which skills and background works based on the above.
Even if you're not good at optimization, with this sort of approach you'll end up with a character that fills a needed niche, so it will still be unlikely to feel useless. That is, unless you misjudge what niches will be needed - but that's life. So explain this process to them, and have them apply it. If they have something specific they want, like a player who definitely wants to play an elf, they can just go through the steps as usual and pick elf when it's time to choose a race - knowing that they will definitely be an elf will probably make some choices easier.
Be available for help
Another possibility is to have them create characters, but be there to talk them through doubts they may have. Honestly, this is basically the same as the previous option except more work for you, although there is the benefit of less uncertainty about what sorts of challenges the DM plans to give them (since the DM is right there to say it). Even better if you can have them sit around a table and work together, so that they're sure the party will fit together.
Presumably, this will alleviate the doubts they have, since all those concerns have already addressed during the creation phase.
Also, you mention:
One had mostly bad rolls as a ranger,
If this is the problem, just use point buy or an array. The chance of getting truly bad rolls is actually very low, but this way it is zero (and more importantly, players can plainly see that).
Let the characters grow organically
With indecisive players, you might want to start at Level 1, and give them plenty of opportunities to grow in the direction they want. For instance, you say:
They're second guessing themselves, and they're discussing options based on what they think the group "needs" and not what they want.
Most classes make their specialization decision at level 2 or after, and you start getting feats only at 4. So actually your character is far from set in stone until about level 2-5. If they feel they have missed some crucial niche, they can simply level up accordingly.
On your end, you can help this along by giving more XP per session for faster advancement, or giving magic items that help address their shortcomings.
Tailor the campaign to the characters
It's really very hard to make a truly terrible character. You have to deliberately work at it. On the flip side it's also hard to make supremely powerful characters, but the 90% in between is usually characters who are good at some things and bad at others. It's all a question of whether the campaign you end up in has a lot of the former or the latter.
Consider a Fighter that is "badly designed" - he has low Str, low Dex, low Con because the player put his best rolls in Cha and Wis. He is bad in combat, and can't even wear heavy armor. Sounds useless, right?
But let's say in the campaign the players act as political officers or military police. The war has been won and the enemy country is occupied. Actual combat is rare, and when it happens, it's usually not "balanced" (weak old peasant tries to desperately attack the high level PCs) because the emphasis is not on the difficulty of the combat but dealing with the social consequences of it. The "poor fighter" could do very well in this scenario, both at dealing diplomatically with civilians, rooting out spies or traitors, and commanding his own NPC subordinates. Armor doesn't matter all that much if he's walking around in dress uniform all the time, in social situations where armor would not have been worn. Meanwhile a typical "good fighter" who deals a ton of damage is useless, because there's hardly anybody to fight, the few combats are already easy or can be made easy by using the right approach, and few problems can be solved by fighting.
Another example would be a wise old sage who has a bunch of Knowledge skills. If the campaign involves a lot of research (maybe the PCs often have to hit the library to track down ancient artifacts) this could be a very valuable character. But if you as the DM hardly ever ask for a Knowledge check, and when the player successfully uses the skill you don't give them interesting information, those skills were a waste. Conversely, if you see a character with a lot of Knowledge skill struggling to be useful, perhaps it's time to have more gameplay elements that call for them to utilize their strengths.
There is one case that's particularly difficult, though: When players have such a heterogeneous party that it's impossible to involve all of them. If you have a bunch of combat optimized characters, and a bunch of strictly diplomatic characters, the best you can do is have a bit of combat that the diplomats sit out, then have the fighters sit it out while the diplomats resolve a social encounter. This is best avoided, which is why you want players making characters that fit together somewhat.