I'm afraid there is no simple answer. Many prepositions are collocations- there are no rules, just the habits of the speakers. It is an area that causes learners a lot of difficulty because it's a question of learning them. However, on the plus side, mistakes generally don't cause much confusion. Students often say 'married with', which doesn't impede comprehension. By and large, it is a matter of practising them.
Click here for some
preposition practice.