How do you know when a graph is a function or not? Could I please have and example

mentally visualize a vertical line scanning your graph from left to right.

If at any place that line cuts your line in more than one place, then your line is NOT a function.

This is called the vertical line test.
e.g. the graph of a circle is not a function.