The letter r has 2 distinctively different pronunciations in Spanish: a soft one, similar to the English tt or dd sounds (as in jetty or Eddie) and a strong, rolling one.
The soft sound is used whenever a single letter r is in the middle of a word between two vowels (caro, puro, aire) between a vowel and most consonants (tren, jardín, parte) and at the end of a word (caminar, comer, recibir)
The rolling r is at the beginning of a word (reto, rapid, rojo) or after the consonants l, n, and s or when written rr