We use
OF in these situations:
Possession, Quantity, Part of a Whole, Material Composition, Relationship, Origin, Cause or Reason, Subject Matter, Characteristic or Quality, Time or Distance.
We use BY when we talk about:
Agent of Action, Means or Method, Time Limit, Proximity or Location, Measurement or Amount, Authorship, Passage or Movement, Manner, Cause, As a Unit of Measurement.
We use FROM when we talk about:
Origin or Source, Starting Point in Time, Starting Point in Place, Cause or Reason, Separation or Removal, Difference or Change, Material or Substance, Distance, Protection, Recipient.