I've been a DM for about 3 years, and have predominantly run one-shots and short campaigns in DnD5e and PF2e. I have a player who persistently builds primary caster based characters, but then won't do anything in combat but "I stab it with my dagger." They rarely use cantrips, and basically won't cast a leveled spell unless I suggest it immediately before their turn. They seem to enjoy playing despite the fact that they're far too squishy to be a front-line melee character and don't utilize most of their class features. I've talked with them explicitly about how their play style seems to be discordant with the kind of play they want to do, and that maybe next time they should try a paladin/champion or a fighter/rougue subclass with some minor casting. They agreed at the time that sounded like a good idea, but low and behold showed up to the next one-shot with a primary caster, and over 3 hours of play and 3 combats never cast a single spell, including a cantrip.
I enjoy playing with this persons as a whole. They are engaged in the fiction, and are particularly engaged during exploration activities. They tell me they also find combat quite fun, and they are requesting I run a mega dungeon in the near future.
As a general rule, I like to let people play how they have the most fun, but issues have arisen with this play style. Namely, all of my TPKs have been associated with this player charging a squishy character directly up to a significantly stronger villain and continuing to stab it with a dagger until they went down, significantly hindering the party in the action economy and resulting in a TPK. I feel I have to intentionally weaken all of my encounters to keep the party feasible in the face of such mechanically poor combat choices.
What else can I do to help drive this individual towards melee builds, and/or help encourage them to change their play style to better suite the caster classes they choose?
I can see where you are coming from but OP assures us that this player knows about games and specifically makes caster characters. This isn’t one sorcerer with a quirk in their backstory about never using their magic, this is multiple characters in a row. I play with new players all the time. Maybe an occasional person will take others’ suggestions as law, but if they do the same thing too many times in a row or force themselves to use the move you recommended when it still doesn’t make sense, you just keep guiding them.
“Don’t forget you have other cantrips too. Using fire bolt was a suggestion. In this fight, you could try using your shocking grasp to get away. Or you could use your magic missile for some guaranteed damage on that heavily-armored hobgoblin. It uses one of your slots, but now seems as good a time as any. They’re no good to you when you’re dead.”
The DM and even the other players should be chiming in with suggestions on other players’ turns. It can get annoying when you know how to play and others are telling you what to do, but if you had a fighter player who just stood in combat and took a disengage action every turn, wouldn’t you eventually speak up and suggest they try a dodge or an attack instead?