How to create a texturepack that changes the texture and model of an item when holding it?

I know that this is possibel with the new 1.21.4 resource pack changes but don't know how to do it

Continue to help post