I don't mean to sound indifferent here, but you are asking a very broad question that requires several very specific answers. To get started:
First; read the instructions that came with the decoder.
Second; go to the decoder manufacturers web site and down load the rest of the instructions for the decoder that you have.
Third; do a search for decoder installations on this site, and on the Internet.
Once you have done all of that, come back and ask specific questions that you need specific answers to.
Elmer.
The above is my opinion, from an active and experienced Model Railroader in N scale and HO since 1961.
(Modeling Freelance, Eastern US, HO scale, in 1962, with NCE DCC for locomotive control and a stand alone LocoNet for block detection and signals.) http://waynes-trains.com/ at home, and N scale at the Club.
-Morgan