How can I make a third person camera avoid objects?

Basically, I need help making a camera that tracks the player while still avoiding objects so that the view of the character won’t be obstructed.