By Einstein's Special Relativity
People found out that light wave has a finite speed. At that time, people believed that all waves should travel in a sort of medium. Sound waves need air/liquid/solid medium. Water waves need water as a medium. Attempts to measure the speed of light relative to an unseen medium were futile. Einstein then assumes that speed of light is the same no matter what and that there is no such thing as a medium of travel for light.
If light travels at the same speed no matter how fast you go, then space and time perception relative to 2 different observers must be different. The faster you go, the slower time passes relative to a person standing still. Also, the faster you go, the shorter you measure distance between your starting and ending point relative to a person standing still.
All these things happens so that you measure speed of light the same as anyone else.
These perceptions are given in equations of motion using 4 momentum concepts.