Let's take a quick look at the difference between these two prepositions when talking about the physical location of objects. Many people confuse the two, thinking that ON is an effect of gravity. It is NOT (necessarily). Here's the best way to understand the difference:
ON: "contact with another surface"
The cup is on the table. The wedding ring is on my finger. My shoes are on my feet. There is a painting on the wall. There is a fly on the ceiling. The hat is on my head. I have a stain on my shirt. The words are written on a piece of paper.
IN: "contained" / "part of a bigger thing"
The water is in the cup. My feet are in my shoes. I put the shoes in a box. There is a dead fly in my food. The words are written in a book. There is money in my pocket. I live in Bologna.
Hope this help in your learning on this Forum.