As others said, its trial and error, though there is a power tool used by physicist to have pointers to deduce formulas, its dimensional analysis, look it up there are some neat stuff you can deduce, for example you can deduce (kinda) the period of a pendulum based on the assumed variables it should depend on (weight, length of the string, gravitationnal constant, initial angle, etc. See what you can ditch and try to make homegeneity work)