A general way to go about it would be to use the red give item blocks to add items to you or the player's inventory -- here's an example of a mod that uses the give blocks: https://mod.learntomod.com/badge_builders/3065?sequence=9054&position=47
When the mod is run, the items should appear in your hotbar in minecraft.
Then, you may want to use it with an event block of some kind to act a trigger. It could be a player interact event or a player chat event maybe.
Here's an example of a mod that gives you multiple items and depending on which item you're holding, something will happen: https://mod.learntomod.com/badge_builders/3419?sequence=9291&position=0