Its really, really hard.
Sometimes natural experiments happen all on their own. For example, states with similar economies may enact different economic policies and you can watch how those economies diverge.
Most of the time, though, that doesn’t happen. Economic models aren’t empirically tested – they are developed based on existing data and the model is the best explanation for that historical data the economist can come up with.
Validation of economic theories varies significantly depending on what is being validated.
For many microeconomic or behavioral economics theories, they are actually tested in controlled experiments. For example, they could select two test subjects, and play some sort of coordination game that pays money based on their choices.
Other theories, particularly in macroeconomics, are tested using statistical methods (usually called econometrics). At it’s core, econometrics tries to described the economy using linear equations often defined by regression analysis (ELI5, finding out which line has the best fit for the data set). For example, an equation could describe “for every X percentage point interest rates increase, unemployment will go up by Y percentage points”, etc.
It is extremely difficult to isolate variables in economic models. In the same way your weight is a function of many factors such as your age, how much you exercise, how many calories you eat, genetics, and stress unemployment is impacted by interest rates, commodity prices, government spending, education, and even the weather.
Latest Answers