The first thing to do is Find the Fun.
I ran a campaign in a bygone century with all brand-new gamers. They made every mistake in the book. But to this day, you get that gang together, and they will start laughing about every failed rescue mission and chaotic retreat.
They enjoyed the feeling of doing something entirely new and being a little at sea. Me leading them by the nose towards the right answers would not have been enjoyable for this crew.
On the other hand, if folks are getting frustrated and confused, then judicial hints are in order. You have the right idea, but don't let an NPC become too much of a hint machine — either the players will resent the “nanny” or they may become too passive and let the NPC guide them.
Can you adjust your campaign to their skill level?
How much help you need to give will partially depend on your campaign. If you are running a homebrew, you can dial back the danger so the party can survive.
If you are playing a published campaign (especially a non-introductory one) then the danger may ramp up more quickly than the players are ready to cope with. You might either need to give more frequent hints, scale back the hazards in they encounter, or hand out more treasure (like healing potions).
Are they missing out on whole parts of the game?
If the players are just not figuring out the basic things they need to do, and are missing out on part of the game, then a little guidance is needed. (Sometimes this happens when folks have played video game RPG’s, which provide a simplified play experience compared to “real” D&D.)
For example, players should know:
- There is secret stuff in dungeons they should search for.
- NPC’s are worth talking to. Unlike some video games, they may have more than one thing to say.
- Players can contribute to the story, rather than just waiting for it to be revealed.
- Combat is tactical; a plan can be important.
There are tutorials out there
If you feel your players could benefit from a little general background on how D&D is done, there are lots of options out there that Googling "How to play D&D" will turn up.
My favorite crash course for learning about D&D is the B movie, Gamers: Dorkness Rising.
Judging fun and frustration
It can be a little tricky judging whether a little exasperation during the game is unhappiness, or just immersion in the tricky situation (especially for a DM, who needs to juggle lots of mental tasks at once). But stopping the action to talk about everyone’s feelings whenever anyone sighs or frowns would wreck any immersion you’ve got going.
Usually any little break in the action is enough to level-set this. When the pizza arrives, the players are leveling up, etc., ask if everyone’s having fun. Let them know that you feel your challenge here is getting the difficulty right for new players. Watch everyone’s reactions. If anyone’s quiet, follow up by asking what they think.