First of all, let's see what it does as a functor : $(M\times -)(X) = M\times X$ and if $f: X\to Y$, then $(M\times f )((m,x)) = (m, f(x))$.
Now, as a monad :
The unit $\eta_X : X\to M\times X$ simply sends $x$ to $(e,x)$ where $e$ is the unit of $M$.
The multiplication $\mu_X : M\times M \times X\to M\times X$ sends $(a,b,x)$ to $(ab, x)$.
Clearly these assignments satisfy the definition of a monad.
An algebra for thid monad is simply an $M$-set, in other words an action of $M$ on $X$.
As a comonad :
The counit $\epsilon_X : M\times X \to X$ is the "forgetful map" that sends $(m,x)$ to $x$, and The comultiplication $\delta_X : M\times X \to M\times M\times X$ sends $(m,x)$ to $(m,m,x)$ .
It's easy to check that this satisfies the definition of a comonad (it's slightly more involved than for the monad part, but barely)