If you have two items, that both effect the same certain attribute and can be equipped at the same time, and one of them is not an armor piece (only possible with commands), removing one will disable the effects of the other.
easy example: these boots and feather both give +.5 speed. hold the feather and equip the boots. remove one of them, and the speed is gone.
feather:
/give @p feather[attribute_modifiers=[{id:"movement_speed",type:"movement_speed",amount:.5,operation:"add_value",slot:"mainhand"}]] 1
boots:
/give @p leather_boots[attribute_modifiers=[{id:"movement_speed",type:"movement_speed",amount:.5,operation:"add_value",slot:"feet"}]] 1
This is a duplicate of MC-272769.