What is Effort Training?Effort Training is easily one of the most important parts of raising any competitive Pokémon. Doing it specializes trained Pokémon and gets the fullest potential of stats, like Speed or Attack. All experienced trainers Effort Train their Pokémon, so neglecting to do it doesn't give your team much of a chance in a competitive battle.
Where does Effort come from?Pokémon, when either caught, recieved or hatched, start with no Effort. When you knock out any Pokémon that gives you experience points, you also get hidden Effort Points of a type and amount specific to the Pokémon you've just beaten. For example, Gastly gives 1 Special Attack Effort Point, Gyarados give 2 Attack Effort Points, and so on. You never get Effort Points from battles in the Battle Tower or with friends, only with wild Pokémon or CPU trainers outside of the Battle Tower. Also, since you can no longer get experience at level 100, no more Effort can be gained once you reach that level. All of these Pokémon give Effort to any Pokémon that was out in battle against them, just like experience. For every four of these points you accumulate in a stat, that stat gets a bump of a single point at level 100. The only way to level up without getting Effort Points you may not want is to put a Pokémon in the Day Care Center, or use a Rare Candy.
Serebii.net's Pokédex has links at the bottom to pages that list what Effort every Pokémon yields, seperated by HP, Attack and so on. I've added a link to Serebii's Pokédex to the links. Some Pokémon give points to more than one stat, so be careful.
You might be thinking you could battle Zubat endlessly until your speed reaches 999, but that isn't the case. There is a limit to the amount of Effort Points one Pokémon can accumulate. 510 is the overall limit for Effort Points, while 255 is the limit for a single stat.
255 Effort Points is 63 potential stat points. That's a lot. If you've used a Pokémon through the course of the entire game, like the Pokémon you started your game with, their effort is likely distributed unevenly across all of its stats, essentially having no use. The best way to Effort Train a Pokémon is to play to their strengths, by focusing the Effort into stats that will make it more likely to survive in battle. To get the full potential of the Effort Points, always try to train numbers that are divisible by 4. 252 Effort Points still gets that maximum of 63 stat points, so going all the way to 255 actually wastes points you could use elsewhere.
Is battling the only way to get Effort Points?Of course, there are other ways to influence Effort Values. Effort Points don't just come from battling Pokémon, but from certain items. Vitamins from the Veilstone Department Store give 10 Effort Points a piece to their respective stat. HP UP adds to HP, Protein adds to Attack, Iron adds to Defense, Calcium adds to Special Attack, Zinc adds to Special Defense, and Carbos adds to Speed. Using these can cut down the work of effort training significantly, but you can't use more than 10 of a single vitamin. Due to the way vitamins work, you should always use them first. You can only use up to 10 in a single stat because vitamins cannot be used to increase Effort past 100 points. Even if you get 1 Attack Effort Point, you won't be able to use all 10 proteins on your Pokémon. When Effort Training, this causes extra work, so always give your Pokémon vitamins first.
There are hold items that also affect the amount of Effort Points gained in battle. The Macho Brace, when held, doubles any Effort Points the wearer receives. There are Power items you can exchange Battle Points for at the Battle Tower, and these are likely the most helpful items when Effort Training. The Power Weight, for example, gives the wearer 4 HP Effort Points regardless of the Pokémon they've just defeated, on top of the points they normally get from defeating that Pokémon. The Power Lens does the same for Special Attack, the Power Bracer gives Attack, the Power Belt for Defense, the Power Band for Special Defense, and the Power Anklet for Speed. These items are priceless when it comes to Effort Training.
Though the items help, you'll have to defeat Pokémon to get the rest of the Effort Points you'll need. If your Pokémon is too weak to defeat whatever you need to battle for Effort, you can send them in first and switch to a stronger Pokémon who can take them down. The Exp. Share item also works, it gives everyone all of the Effort gained in the battle, instead of dividing it like it does with experience points. I always keep a high-level Pokémon with me when Effort Training for this purpose. It can be one you've already Effort Trained and can't get anymore points, or a Pokémon whose Effort you don't care about, and don't intend to use in competitive battles.
What if I screw up?You can also remove Effort Points from any Pokémon, in case you made a mistake or wish to retrain, with berries that have the opposite effect of the vitamins previously mentioned. The Tamato Berry lowers Speed, the Grepa Berry lowers Special Defense, the Hondew Berry lowers Special Attack, the Kelpsy Berry lowers attack, the Pomeg Berry lowers HP and the Qualot Berry lowers defense. You get these berries from the Berry Master just west of Hearthome City.
What are the best ways to distribute Effort Points? That's up to you. Most people who Effort Train tend to slap 252 Effort Points in the Pokémon's two best stats, and put the remaining 6 in some other stat that could benefit from a single stat point boost, like HP. However, it really depends on the Pokémon, and what you intend to use it for. Experiment!
Where are the best places to Effort Train? I'll show you where I Effort Train. These Pokémon appear the same in both Diamond and Pearl. Make sure you have enough supplies before going out to Effort Train, and have the proper HMs.

For HP, there are Wooper on 212 South, right outside of Pastoria City. Wooper is worth 1 HP Effort Point. Bring a Surfing Pokémon, as Wooper appears more often when Surfing back and forth on the water than in the grass. These Woopers will be from level 20 to 40. A Quagsire may appear from time to time, around the same levels as Wooper. He's worth 2 Effort in HP, so take note of that if you defeat one.

For Attack, there's Gyarados on Route 229. Gyarados is worth 2 Attack Effort Points. You'll need the Super Rod to find them. Watch out for Gyarados' intimidate, which lowers your Attack. These Gyarados are between level 20 and 55.

For Defense, Geodude waits for you in the Ruin Maniac's Cave. Geodude is worth 1 Defense Effort Point, and appears at level 22. While Geodude appears most often, Hippopotas can appear from time to time. Both Pokémon are worth a single Effort Point in Defense, so don't treat them any differently.

Need Special Attack? Gastly is your man. The Old Chateau is the place to go, Gastly is the only Pokémon within its walls. He gives up 1 Special Attack Effort Point, and can be found between level 12 and 16. You'll need Cut to get to the door, so make sure you bring it.

If you need Special Defense, go see Tentacruel. He can be found on Route 223 and is worth 2 Special Defense Effort Points. He'll show up between level 35 and 45. Pelipper and Mantyke may appear from time to time, and while Mantyke can be defeated for a single Special Defense Effort Point, Pelipper should be ignored.

When you need Speed, Zubat is your best option. Bring someone who can Surf, you'll be Surfing on a lake inside the Route 207 entrance to Mt. Coronet to find these guys. Zubat is worth 1 Speed Effort Point and will show up between level 20 and 40. Golbat may show up rarely, he's worth 2 Speed Effort Points so take extra note of that if you knock him out.
Once you've gotten all 510 of your Effort Points, a woman in Sunyshore City's Marketplace will give your Pokémon an Effort Ribbon. From this point forward, your fully trained Pokémon will no longer be effected by the Pokémon he defeats and he'll be ready to battle with real opponents. Unless you remove Effort Points with berries, you can't gain any more of them once you reach 510.