Google dictionary has eleven different definitions for the preposition "from" and eight different definitions for the preposition "of." It would be a good idea to note how each word is used and to think of an example for each rule.
In general, "of" indicates a relationship and "from" indicates direction/origin but these definitions are too simple to explain the full meaning of these words.
One thing that I would advise is to remember that English rarely used the "of" before a noun to indicate position. The possessive is more commonly used. For example, the sister of Alfonso will not sound natural in English. Everyone will understand but it is more natural to say "Alfonso's sister."
"From" is a word that tells direction. "I'm coming home FROM work." "I'm picking fruit FROM the tree."
"Of" usually shows someone or something owns an item. "That's the book of Mark" (or: "Mark's book").
It's quite easy to find an answer online - just use these keywords: difference between from of