Once you have placed a chest you can type ‘/protect lock’, followed by right clicking your chest to lock it. This will protect you chest from anyone who would want to open it.
In order to give a player permission to access your chest you can type ‘/protect trust (player name)’, followed by right clicking that chest again. But remember to only allow access to people you know are trustworthy!
If you find that you can no longer trust somebody, you can remove them from your trust list by typing ‘/protect untrust (player name)’, and again right clicking your chest. These commands can also be seen in game by typing /protect help or by using the protect UI through /menu and clicking on 'Personal protection' (the chest icon).