When to use Public Variables

If the answer satisfied the question pls mark it as an answer and the post solved. Thanks!