Psalm 23:5
David was literally anointed on his head with oil by the prophet Samuel. The word (משח) “Messiah” means “anointed one”, “anointed one for a purpose”. However, despite the fact that this is a messianic psalm, a different Hebrew word used in this case.
Since sheep can injure themselves on the thorns on their heads while grazing and the wounds could become inflamed or infested by parasites, the shepherds poured olive oil into the open areas after disinfecting them with wine to protect them.
David might also have this image in mind. If I hurt myself, you worry about my wound.
Before David spoke of the stick and of the people who harass him. Wherever I hit my head, God is present and takes care of my emotional injuries.
However, the anointing with oil expresses the personal care of God for us. Revelation 7:17 says: “God will wipe away every tear from their eyes.”