It is very simple, put the command into a command block: /effect @p (effectId) (time) (multiplier)
For example, i want to give myself infinite speed 100 for a parkour map. /effect @p 1 100000 100 .
The first number "1" is the effect id, you can google every effect and their id's. the second number "1,000,000" is the time lasting for the effect, pretty simple, if you put 1 million for this variable it would be infinite. The third number is 100, it is the speed multiplier; the max multiplier is 255, but obviously it wouldn't change the effect for some, such as fire res.