'Off' is the opposite of 'on'- if a light is 'off' then it is not working; if it is 'on', then it is giving out line.
'Of' connects words, usually without modifying the meaning- 'cup of coffee'. Al 'of' does is join the two words- it has no meaning itself. ;-)