Units have attributes and the system is a little more complicated than warcraft 3.
If you look at each unit it will have one or more of the following descriptors:
For example a marine is a light biological unit while a siege tank is an armored mechanical unit and a marauder is an armored biological unit. This is something you will have to memorize with time but usually you can guess which will apply just by looking at the unit or in doubt clicking on it. These are easily viewable on the HUD just below the units description in the center of the screen.
Now each unit may have a bonus against one of these armors making it a good hard counter. You can see this bonus during game by selecting the unit and viewing the hud in the center of the screen. It will list the damange of the unit and any bonsuses it recieves against units of a particular type.
For example helion's have +dmg vs light armor and are great for killing zerglings, a light biological unit. An Immortal has a large +dmg bonus vs armored units and is a great counter for other armored units such as marauders, siege tanks, roaches or stalkers.
Blizzard has said there will be tutorials in the released version of SC2 to train players for multi-player combat. Part of those tutorials will be explaining by example how these hard counters work and which units to build to counter your opponent.