There are three ways to train a Pokémon's Speed EV: by battling specific Pokémon, using the item Carbos on your Pokémon or using the Super Training feature introduced in the sixth generation. There are also ways to increase the amount of EVs gained in battle.
According to Serebii, Effort Values (EVs) determine the stats of a Pokémon upon leveling up. A Pokémon should have a maximum of 252 EVs in any particular stat. In the original Pokémon games, the only way to EV train a Pokémon was to battle specific Pokémon depending on the desired value. This remains a feature in the more recent games. Many websites, including Serebii, provide a list of Pokémon that can train a certain value. For speed, these include Charmander, Weedle, Basculin and many more. With this method of EV training, it may be effective to give a Power Anklet to the Pokémon being trained, which adds 4 EVs to the amount gained at the end of battle. Carbos is another item that increases the Speed EVs of a Pokémon. Finally, in the X/Y series, trainers can utilize Super Training to train EVs by choosing the EV they wish to train from the Super Training menu.