algoritm to convert a monoid into an automaton
Short answer. See the Cayley graph of the monoid as an automaton.

Details.
Let $L$ be a language recognised by a finite monoid $M$. Then
there is a morphism $\varphi:A^* \rightarrow M$ and a subset $P$ of
$M$ such that $L = \varphi^{-1}(P)$. Take the right representation of
$A$ on $M$ defined by $s \cdot a = s\varphi(a)$. This defines a
deterministic automaton $\mathcal{A} = (M, A, \cdot, 1, P)$. Now, a
word $u$ is accepted by $\mathcal{A}$ if and only if $1 \cdot u \in P$. Since
$1 \cdot u = \varphi(u)$, this condition means $\varphi(u) \in P$ or $u
\in \varphi^{-1}(P)$. Since $L = \varphi^{-1}(P)$, we conclude that
$\mathcal{A}$ recognises $L$.