This document presents the construction of encoding and decoding algorithms for an optimal double error correcting (12,8) linear code over the ring Z5. Specifically, it describes: 1) The parity check matrix that defines the code. 2) How to construct the generator matrix to enable encoding of messages as codewords. 3) The encoding procedure that generates a codeword from a message by multiplying it with the generator matrix. 4) The decoding procedure that identifies and corrects up to two errors of magnitude ±1 by calculating the syndrome and finding the error positions. Examples are provided to illustrate the encoding and decoding processes. The approach is proposed to be extended to other ring constructions.