Updated:

1. Run faster

/effect give @s minecraft:speed 60 1 true
/effect @s speed 60 1 true

The first line is Java, the second Bedrock. The amplifier 1 means Speed II.

AmplifierLevelApprox. speed
0I+20%
1II+40%
4V2x
9X3x

Very high levels make turning hard. Levels I to III are best for travel.

2. Permanent speed

/effect give @s minecraft:speed infinite 1 true

Java accepts infinite. On Bedrock, use a large number of seconds such as 99999.

3. Jump higher and swim faster

/effect give @s minecraft:jump_boost 60 2 true
/effect give @s minecraft:dolphins_grace 60 0 true

High Jump Boost can cause fall damage when you land.

4. Change base walking speed (Java)

/attribute @s minecraft:movement_speed base set 0.2

The default is 0.1. Set it back to 0.1 to reset. See the attribute command.

5. Reset or slow down

/effect clear @s minecraft:speed
/effect give @s minecraft:slowness 30 1 true

Bedrock clears all effects with /effect @s clear.

6. Faster horses and mounts (Java)

/attribute @n[type=horse] minecraft:movement_speed base set 0.3375

0.3375 is the fastest a naturally spawned horse can be. Higher values are faster but harder to steer. @n picks the nearest entity (1.21+). Change jumping with minecraft:jump_strength. See the horse command.

Troubleshooting

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.