I believe you're talking about prepositional verbs, combinations of a verb and a preposition which have a meaning when used together other than that implied by the meanings separately. (These are not to be confused with separable verbs where a preposition is combined with a verb as a prefix.) A good example, as you mentioned, is glauben an, which is "to believe in" in English. There are other prepositional expressions as well, for example Angst vor = "Fear of". The question is, if the preposition can be followed by accusative or dative, then which case is used when a prepositional expression involves that expression.
The good news here is that each expression is always followed by a specific case. For example, glauben an is always used with an accusative noun, never a dative noun. The bad news is there is no general rule, at least as far as I know, that tells you what that case will be for every expression. There are some trends, for example accusative is more commonly used than dative, but there is no general rule without so many exceptions that it's practically worthless. Sometimes the case makes sense if you give a certain figurative interpretation to the expression, but I don't think you can turn something like that into a reliable rule.
Some dictionaries list prepositional verbs under the verb in question. For example DWDS defines glauben an. In this case DWDS does not explicitly say accusative, but you can deduce it from the usage examples. English Wiktionary defines glauben an in definition 2; the label there says "intransitive, with an + accusative" which pretty well sums up the situation. German Wiktionary lists glauben an under meaning 4 and uses the label "an jemanden (/etwas) glauben" (Akkusativ). This tells you the case explicitly and you can also tell because they use jemanden rather than jemandem. So dictionaries often include case information in their entry for the verb, though the way this information is listed varies. Unfortunately, the dictionaries I've seen don't always include prepositional expressions, so you may have to determine the case yourself based on usage.