The staff the psalmist (very likely King David) refers to can have several meanings depending on how it’s used. In Old Testament times, the staff could be a scepter, walking stick, crutch, or some kind of support or prop. For Psalm 23, the staff is two different things.
A Staff Gives Rest. Psalm 23 starts right off with equating the Lord with a shepherd (“The Lord is my shepherd; I shall not want.”). So, we know immediately we’re talking about shepherding tools. A shepherd might use a staff as something to lean on in case the ground is not dry or safe for sitting or for support when he needed rest during long shifts tending the sheep.