Depends on what you have at your disposal and in how much of a hurry you are. If possible, you should exploit any range advantage.
If you have tanks, mortars, infantry guns or artillery at you disposal, stay where you are and pound the enemy infantry silly before you move on. Heavy MGs can also be used to suppress and subtle differences in infantry armament can be exploited as well. Some infantry units, particularily early war, do not have machineguns, only rifles, which can give you a small 1-2 hex range advantage. If that is the case, you can sit back outside rifle range and suppres the enemy infantry that way.
Then you can move in and get close and personal. Of course, while doing so, you may run into other enemy units, which will also have to be suppressed.
If you have no supporting arms and have to move on, have one unit in front while the rest of the platoon is in support and try to deal with the enemy infantry one unit at the time. This would mean playing the "suppression game" at long ranges, trying to get the upper hand. Should the opposition turn out to be too strong, you can likely extract most of you platoon, only risking the forward unit.
Trying to move on, into the enemy fire, to get close without suppressing the enemy will likely result in your advancing units suffering unneccesary casualties and suppression. Also, as more enemy units may pop up and fire at you, you could end up suppressed and pinned trying to fight a larger force.
With tanks, the game is similar. However, if what is firing at you cannot hurt you, just move closer, in the same manner as with infantry - one tank forward, the rest of the platoon in support. Do not move next to enemy infantry. They might close assault and destroy your tank. Also, you may be hurt by the blast from your supporting tanks firing at the enemy unit if you are too close. If you bump into enemy antitank weapons, you need to assess whether they constitute a real threat or not. Tigers can get pretty close to 45mm AT-guns, for example, while the same gun can be deadly vs a light tank. If the anti-tank weapons can defeat you, stay at safe range and try to find out where they are, then pound them with HE (use Z-fire until you know exactly where they are). Of course, you should also call in supporting arms, if the tanks cannot deal with the threat themselves.
Trying to press on regardless with tanks can easily end in tears, as it only takes one shot to wipe out a tank, while infantry is more resilient to damage.
My two ørers worth, anyway
Claus B