i need help with getting the right click of my custom hats to equip

i have made a data pack using a advancement to equip a diamond to my head that i give to my self with a command but its not working plz help

Continue to help post