Each manufacturer provides instructions with decoders. Read them! Take a close look at the operation of the locomotive you want to convert when it is running on regular DC. Installing DCC decoders will not improve the mechanical operation of your equipment! Prior to installing the decoder is a good time to audit the mechanisms and give them a good tune up (since you already have the shell off). Be very careful when you take you locomotive apart, don’t lose any of the little parts that tend to fly off in every direction. If you decide not to install a decoder in a given engine but plan to run it on a DCC layout do the tune up anyway. If you are working with Athearn diesels, the November 1993 issue of Model Railroader (Page 106) has an excellent article on tuning up these engines.
The mechanical placement of the decoder is important and may involve sculpting plastic and or metal parts to allow enough room for installation. Decoders from different manufacturers have different form factors. You should choose the one that has a current rating appropriate for your locomotive and that fits best in your locomotive. Try to locate the decoder in the coolest part of the body. Your decoders will provide more power to your motors if they are installed away from heat sources inside the locomotive body like motors and lamps. Try to put them where they can shed as much heat as possible.
Obviously, the scale you model will have a bearing on the ease or difficulty of decoder installation. In G scale, there is usually lots of room inside for decoder installation, the trick is removing the shell. Even though decoders are smaller today than ever, it is still a tough job to get them into many N-scale engines. The small size of the HO decoders has made installation possible in most diesels and steam engines. Some of the smaller switchers still present a challenge and some modelers use the smaller N-scale decoders in these with no problems. For N-scale modelers replacement frames really simplify decoder installation.