#You don't
You don't
Part of being in a D&D group is having your own strengths and weaknesses.
Should the PC get into a situation where he ends up being "useless", he needs to do "something else": distract the enemy, help out the team in other ways, or take this as a hint to include a secondary role (and attack style).
DM's role as a coach/mentor
For this reason, I always recommend to new players to take two attack types: archers should have a melee weapon, and melee attackers should have a ranged option (even if you don't plan on using it), unless there is an in-character reason not to.
OP stated that the specific character has utility spells: when his lightning is useless, he can use those: buff the party (haste, enhance ability, enlarge, ...) or debuff the enemy (slow, ray of enfeeblement, black tentacles, ...). Explore with the player all of the various ways that the Sorcerer can use non attack spells to help the party or vex the enemy (slow, web, grease, banishment, etc).