An array is an ordered, integer-indexed, or string collection of any object. What does that mean? It pretty much means that an Array is a group or list of information in order, which has a specific location for each element, also called an index.
Arrays are very helpful when you are trying to store large amounts of information. Remember the last time you were in school? Ever wonder how the school would store all of the students in their computer database...Arrays are how!
That is just an example of how an array is used in the real world, but it doesn't always have to be student names, they can also be used to store numbers (integers). Think of the same example of being in school, how do schools store each student's personal ID number? They can store that information as an array (example. studentName=["John Smith"] and gpa=[543210]).
How do you know when to use an Array? Whenever you are trying to store a list or group of information and you need some way of pointing to a specific item (element) you want to use an Array.
A Hash is a dictionary, a collection of unique keys and their values. A Hash and an Array are similar, but where an Array uses numbers (integers) as its index a Hash allows you to use any object type. What does that mean? It pretty much means that a Hash also stores information kind of like an Array, but you don't need to use numbers to set its place, you can pick what ever you want!
Hashes are very helpful in comparing large amounts of data, you create the hashes for the data, store the hashes and later if you want to compare the data... you just compare the hashes. That's not only what Hashes are useful for! They can also be used to index data! Lets think of the Simpsons, yes the cartoon! If we wanted to use that as an example of how to make a hash it would look like something like this:
What we have above is a Hash that has the Simpsons family names and what role they play in the family structure. The names are the "keys" and the roles are the "value".