(A question was closed as duplicate of this question, but the answers to this question do not even mention vocalic "r" !? So I write my answer here.)
The pronunciation of German "r" depends on whether it is in front or after a vowel. In regional dialects, "r" is famously pronounced differently from the standard in Germany, but I won't touch on that, because there are already other answers on that and I am not too familiar with Southern accents. For Standard German German, the rules are as follows:
If "r" is in front of a vowel, it is typically pronounced as a voiced uvular fricative [ʁ] or approximant [ʁ̞].
If "r" is not in front of a vowel and after a long vowel, it is pronounced [ɐ] and forms a diphthong with the preceding vowel, so Rohr is /ʁoːɐ̯/.
If "r" is not in front of a vowel and after schwa, the entire sequence "er" is pronounced [ɐ] except for in careful speech, so roher is /ʁoːɐ/.
If "r" is not in front of a vowel and after a short vowel, it can be both a voiced uvular approximant [ʁ̞] or the vowel [ɐ], so "Herz" would be [hɛʁt͡s] or [hɛɐ̯t͡s].
There are some variation possible in front of [j] and [ən]. So words like "Ferien", "führen" can both have consonantic or vocalic "r". If "r" is in between vowels, is can also be both, [ɐʁ], for example [ˈlɛɐ̯ʁɐ] for Lehrer.
Other things to note: Length is often neutralized in front of vocalic "r" (Wiese (1996), via https://en.wikipedia.org/wiki/Standard_German_phonology). The vowel [ɐ] is not always distinguished from [ä], so "Oper" and "Opa" are pronounced the same for some speakers. In my personal observation, the pronounciation of vocalic "r" after "i, u, ü" is closer to [ə] than to [ɐ], so that "Karls Ruhr" might actually sound closer to "Karlsruhe" [u:ə] than to "Karlsruher" [u:ɐ].