How to get the Face Index and be able to get the Material from a Sphere or Capsule Trace?

As the Title says.

I only ask this question with the intention to answering it myself as i just discovered how to do it, and i want to make it easily Googlable for others to discover this as well.