One phrase for several social moments
Costa Rica’s tourism authority describes pura vida as a phrase with several conversational functions, not simply as a translation of goodbye. At the end of a friendly exchange it can acknowledge the encounter and send the other person on their way. When someone uses it on arrival, it has a different function. The surrounding conversation tells you which meaning is intended more reliably than the words themselves.
A conventional goodbye is always useful
Pura vida is worth learning, but you need not use it every time you leave a place. A conventional adiós or hasta luego gives you an unambiguous ending, particularly in a conversation that has been mostly practical. If someone closes with chao, you can respond with the same word. Listen to the register rather than treating one expression as an obligatory marker of local identity.
Wishing a guide or host well
A polite Que le vaya bien is a useful parting wish for one person you address as usted. This form of address can be heard in a range of Costa Rican relationships, not just very formal exchanges. If you are unsure which pronoun a speaker prefers, a short goodbye that avoids direct pronouns is easier to use. Nos vemos is also an option after a friendly exchange.