Decoders, Detectors and Demodulators
Your question 1) is too broad to answer. In general, the optimum decoder finds the code word that is closest to the received word. In most cases, the computational complexity of such a decoder is too large, and suboptimum decoders are needed.

As for question 2), a "detector", in the original sense, is an analog circuit that "detects" the message from the received signal. For example, in AM, an envelope detector recovers the modulating signal. In digital communications, it is commonly used to denote a system that recovers the symbols from the received signal. A "demodulator" would recover bits from the symbols. Finally, a (hard decision) decoder performs error control on the received bits.