This is specifically how I do it. It is a little ugly and it might not be the best way, but has worked on bikes used for some really rough riding.
FInd a wire that is accessable and has switched power like one of those described above.
Find a convenient place and use an exacto knife to peel away about 3/4" of insulation. Strip back the insulation on the wire you are going to splice it. Wrap the bare wires together. Solder them. Wrap electrical tape around the splice.
I use a lot of those two-pronged SAE connectors. I create them by buying 12" two-conductor SAE extension cables at AutoZone and cutting the wire and getting two plugs to use. As the guy said it is really important that the positive wire be on the female side of the connector.