The answer to your question is in the image you attached. The meaning is given in parentheses: the meaning of “de” is #1 and the meaning of “a” is #2
A more useful answer is that prepositions can be very difficult to master because they have vague meanings and many times their usage is a matter of convention rather than some precise meaning. The truth is that you have to memorize different usages.
We answer specific questions about Spanish or English vocabulary and grammar. I’m afraid your question is too broad for this forum. We can’t help with grammar rules unless there is a specific phrase or example as starting point, so this thread is being closed. Thank you.