We didn't do " stranger danger".
A friend/neighbor had our children close together and were together a lot with our children.
We labeled ( wrong choice of words but that's what it was) everyone as red, yellow, green.
Green = anyone very close and meant SAFE as parents, siblings, relatives
yellow= caution. People you may know such as neighbors, teachers, bus drivers, etc
Red= someone you do not know at all. Grocery clerk, librarian, etc
This helped us. I recall my daughter saying red person to me when she was little :) I explained yes, red ppl can be very nice, we just don't know them like Green ppl.
Best wishes