As I understood it, du is for friends/family while Sie was more polite and formal for everyone else.I practice whenever I run into German speakers but that’s not very often.
That’s essentially correct but not always. Some elders or authorities are nearly always “sie” and small children are nearly always “du” but it’s very easy to find yourself in a seeming gray area, getting it wrong and insulting some burgher or hausfrau by sounding too distant (snobbish) or seemingly treating them like a child. Obviously I never fully mastered it despite a semester of immersion in Trier.