These are prepositions.
To - - - can be used in various ways, but as a preposition it points out an object/place where you direct your verb/action.
ex. She will go to the mall. (go->to->mall)
mall-place (noun) directed by "go"
In - - - same function (preposition) but refers to a specific location which is inside
ex. The cat is sleeping in the house. (sleeping->in->house)
On - - - when the location is on/on top of something
ex. I placed the mug on the table. (placed->on->table)
table-location (on top)
Of - - - is a function word, component, reason or possessive (ownership)
ex. She died of flu. <--- reason
A cold cup of water <--- component