Java 26.2
Effects
Speed
Apply to @p
/effect give @p minecraft:speed 30 0 false
Two things trip people up with /effect: the amplifier is one lower than the level shown in game, and the duration is in seconds, not ticks, which is the opposite of potion item data. Set both visually here, use the infinite keyword where the version supports it, and hide the particles when the effect is a game mechanic rather than a visual.
Give and clear
Java 26.2
Apply to @p
/effect give @p minecraft:speed 30 0 false