Making items give you abilities in Minecraft is very simple and easy to learn. I would recommend watching the video below to make sure that you understand the command before proceeding to the commands.

Commands Used In The Video

The command below makes the player levitate when holding a diamond.

/execute at @e[nbt={SelectedItem:{id:"minecraft:diamond"}}] run effect give @e[nbt={SelectedItem:{id:"minecraft:diamond"}}] minecraft:levitation 1 10 true

The command below makes the player fast when holding a blaze rod

/execute at @e[nbt={SelectedItem:{id:"minecraft:blaze_rod"}}] run effect give @e[nbt={SelectedItem:{id:"minecraft:blaze_rod"}}] minecraft:speed 1 5 true

The command bellow makes particles when an iron axe is held

/execute at @e[nbt={SelectedItem:{id:"minecraft:iron_axe"}}] run particle minecraft:soul_fire_flame ~ ~ ~ 2 02 2 0 10 force @a[nbt={SelectedItem:{id:"minecraft:iron_axe"}}]