Function when i consume something

can someone help, how do i make it so that when you eat something it runs a function here's my code { "type": "minecraft:crafting_shapeless", "ingredients": [ [ "minecraft:yellow_dye" ], [ "minecraft:writable_book" ], [ "minecraft:yellow_dye" ], [ "minecraft:yellow_stained_glass_pane" ], [ "minecraft:mace" ] ], "result": { "id": "minecraft:cooked_beef", "components": { "minecraft:item_model": "tutorial:yellow_card", "minecraft:item_name": "{"bold":true,"color":"yellow","italic":true,"text":"Yellow Card"}", "minecraft:consumable": { "consume_seconds": 0.1, "animation": "none", "has_consume_particles": false, "on_consume_effects": [] } } } } thats the recipe for the thing and i want to make it so that when you eat it it runs a function. Ik the function name and have tested it and it works, so can someone help me run the function
Continue to help post