How to make Casters and Martials equal in all respects:
Make a game in which they're equal.
That's literally it. If the Wizard can hit 4 people with Magic Missiles then the Fighter can hit 4 people with Normal Missiles. If the Wizard can roll Intelligence to open the magic force-door, the Fighter can roll Strength to open the magic force-door.
And then take it further so that the outcome is equal even if, narratively, the description is different.
The Wizard casts Fly to get to the parapet in 1 turn. The Fighter climbs to the parapet in the same turn. The Wizard neutralizes the poison in their food with a spell, the Fighter just muscles through it with high Constitution.
D&D, though, is bad for that because it was never meant to be balanced between classes.