First, you need to know its strength and weaknesses. For example, Scolipede has a good Attack and Speed, so obviously I'll need to have those two at maximum. So the best IV line up will be x/31/x/x/x/31. If you're looking for a 5 IV spread, then as Scolipede's weakest stat is Sp.Atk, and its not going to use it, the line up should be 31/31/31/x/31/31. Hp, Def and Sp.Def are normally the three stats you want to have maximum IVs if you're looking for the perfect Pokemon. Otherwise, they'll go down quicker. Trick Room Pokemon are normally aimed to have 0 IVs in Speed to utilize Trick Room.
For natures, unless you're looking for a mixed Sweeper (aka. one that deals both Atk and Sp.Atk), we obviously have to reduce the other attacking stat so we won't have any lack in defenses. Those with low Speed stat, or needed to be slow, normally have a nature that boost their highest stat and reduces their speed. Eg. Brave Aegislash will give it an attack boost and lower its Speed so people can utilize its defense form to defend before starting the attack.
For EVs, a certain amount of Speed is normally given to outspeed several Pokemon that could hinder it. At least, that's far as I know regarding about EVs. I normally give its main attacking power a little boost, but most ideal of the EV spreads is giving it a slight boost in their defenses, again, so they would last longer. Smogon is a good place to check out about EVs.
Obviously, abilities must be one that the Pokemon can utilize the most. You don't need a Dragalge with Poison Touch since its a Sp.Attacker. Pokemon with ability to induce weather are often paired with Pokemon that could use it... Hence why Drizzle + Swift Swim is banned at the 5th gen. For those that only have a single ability, then you have to know how to use it.