Well generally it's knowing the strength of the supporting materials and then doing the maths on the intended design. In simple terms you do not have to test an RSJ to know how much weight it will take. In more complex terms a bridge is the same. An architect will design a bridge and an engineer will collaborate to "make it work" and that means a lot of mechanics and applied maths.
Do what I did and go on a four year Civil Engineering degree course, where you learn the basics, then go to work in an office where a computer works it out for you!!