What is the difference between respect of others and respect by others? Is there any rule that applies here?
Prepositions have slippery meanings in English. Sometimes they look like one thing, other times something else.
'Respect by others' is the respect from others to oneself.
'Respect of others' ('for' would probably be clearer to you) is respect from oneself to others.
'By' and 'for' are fairly clear here, but 'of' is as ambiguous, but is pragmatically in this context obviously the respect one has for others.
There's no steadfast rule, but vaguely what I have outlined here.
Respect of others is pretty much the same with respect by others (they both mean the respect that other people of the community have for you) You can focus on slight differences, such as you would say "you gain the respect of others" but "you gain respect by others", but the meaning would still be the same.