I don't know which system or specific character class you're talking about but a general guideline is to stay in the background and let all the muscle characters do the fighting until you go up in levels.
If the magic characters you are referring to come from a Dungeons & Dragons -esque setting then you need to Think More. Brain before Brawn and possibly even more crafty than the Rogues and Thieves.
Realize that mages are typically portraited in Dungeons & Dragons type settings as having zilch for Hit Points, little Armor Class, and absolutely no Combat Skills whatsoever. It really is a thinking man's class and character. Picture if you will a really good Chess Player, unless you throw the pieces and use the board for a shield, how else would a Chess player defend themselves or attack?
I feel that Pathfinder and fifth edition have done that. It was a huge problem before with basically no hit points or armor. Magic users had limited spell slots and they had to conserve their spells. Should I use this spell or save it for a bigger fight? They were horrible at combat so if they wanted to save their spells or were out all they could do was hide during combat. With Pathfinder and fifth edition magic users have unlimited cantrip use. This made a huge difference. Many of the cantrips are pretty good. Now they will always have something they can do. The damage dealing ones are like an attack from a weaker fighter. It is still much better than the magic user wading into combat with a dagger. Magic users won't feel useless for much of the game at very low levels like before. It is a much needed improvement in my opinion.
Mages are weak in hit points. But they can stand in the back ground and throw darts to help out the others on the front lines. As said before a mage is a thinker and one that will try to stay out of combat as much as possible. Even a high level mage does not want to be in combat but know that some of their spells can help their front line fighters.
Maybe its not the best way to play but its the same reason I always select a fighter as a character. They are hardy and can trust in their weapon and strength. I do not like having limits on spells I can use per day, etc. Just imagine if I had a limit to how many times I could swing my sword - that wouldn't be very productive in a fight.
Txtrpg,
You bring up the issue I have with melee classes in several Role-playing Games. There should be some limitation to how often a melee weapon could be used. A ranged weapon is limited by its rounds of ammunition and how fast it can be reloaded and fired.
Melee weapons should tax the individual using them. Using stamina, strain, or energy to swing a weapon, block with a shield, or takes blows to their armor. What are the limitations to a fighter/warrior class? For the most part no limitations exist.