Einstein didn’t discover things like time dilation experimentally. He made a couple of assumptions based on the experiments of others and deduced what the world would be like if these assumptions were true.
Before Einstein, most physicists believed light was a wave, and like most waves, it had to have a medium. For example, the medium for sound waves is air, and the medium for ocean waves is sea water. They assumed that light waves traveled in a medium they called the “ether.” The ether, if it existed, would have provided an absolute frame of reference for all motion.
In the late 19th century, a couple of physicists decided to measure how quickly the earth was traveling through the ether. They set up a sophisticated experiment using an interferometer - there’s a pretty good description here. The experiment depended on measuring differences in the speed of light relative to the earth’s motion - light going the same direction of the earth through the ether would look slower than light going perpendicular to the earth’s motion through the ether.
They found that they couldn’t measure the speed of the earth going through the ether. The measured speed of light was always the same, regardless of the direction of the light relative to the earth’s motion. No one knew how to explain these results.
Einstein solved the problem by assuming the speed of light in a vacuum is a universal constant - that a beam of light will have the same speed relative to an observer no matter how the observer is moving. For example, if an observer is moving in the same direction as the light, the light will appear to have the same speed as if the observer is moving in the opposite direction. This assumption means there is no absolute frame of reference. Einstein figured out the implications of the assumption and published it as his special theory of relativity. Physicists validated the theory with experiments over a period of years.
I remember that NASA tested time dilation by putting a very accurate clock aboard a space flight, while an identical clock remained on earth. Einstein’s theory predicted that less time would pass on board the space flight than on earth, because of the acceleration of the flight. Indeed, when the flight returned to earth, the clock aboard the flight was slightly behind the one that had been left on earth. The difference in the clocks’ times was close to what NASA scientists had predicted.