/execute as @a[nbt={Inventory:[{id:"minecraft:bedrock"}]}] run effect give @s <effect_name> <seconds> <amplifier> <hide_particles>
What to change:
<effect_name>: The name of the effect - starts with minecraft: (write the command in the command line and use TAB to fill it in properly)
<seconds>: For how many seconds should the effect last - in seconds (minimum: 1)
<amplifier>: How strong should the effect be - number (range: 0-255, 255 is max strength)
<hide_particles>: Should the particles be visible (true/false)
If you want to do more than 1 command, make a function and replace everything after run with function <function_name> (again, use TAB to properly replace everything)