The instant read thermometers are great for this. That's the only way I can tell for sure, except for peeking (cutting into it and looking, but sometimes you don't want to do that if you're serving it to company...haha).
It is mainly experience telling how long to cook a steak to preference. You can cut into it as others have said, which is fine, when cooking the steak for yourself. Practice makes perfect, cook lots of steaks.
No! No! Nooo! You Cannot Puncture The Outer Layer of A Steak While It Is Grilling.
If you care enough to cook, barbecue, smoke or grill good red meats you have to put in the time to appreciate the flavor a varied textures. After cooking 2 or 3 steaks you should be able to press firmly with a finger to determine the "squishy-ness" of the meat. Obviously the food will toughen up as it cooks but the texture and firmness will be different depending on pan-frying, grilling, smoking, barbecue, etc.
Cutting into the meat or puncturing the surface with a temperature gauge, fork, knife or anything else will cause the inner meat to change its ability to have moisture and a different texture than the outer layer affected by the type of cooking. Never break the surface of red meat while it is cooking!