Suppose that $X,M$ are of size $n \times n$.
Note that, if no further constraint is placed on $X$, then this is simply a linear system of equations. We could solve this linear system by "brute force", assuming $M$ is sufficiently small.
Note that the equation can be rewritten as
$$
MX = -X^TM \implies MX + X^TM = 0.
$$
With (column-major) vectorization, we could rewrite this system as
$$
[(I \otimes M) + (M^T \otimes I)K^{(n,n)}]\operatorname{vec}(X) = 0,
$$
where $I$ denotes a size-$n$ identity matrix, $\otimes$ denotes a Kronecker product, and $K^{(n,n)}$ denotes a commutation matrix.
For a $2 \times 2$ matrix $M$ with entries $m_{ij}$, the above equation is
$$
\left[
\pmatrix{
m_{11} & m_{12} & 0 & 0\\
m_{21} & m_{22} & 0 & 0\\
0 & 0 & m_{11} & m_{12}\\
0 & 0 & m_{21} & m_{22}}
+
\pmatrix{m_{11} & m_{21} &0& 0\\
0 & 0& m_{11} & m_{21}\\
m_{22} & m_{12} & 0 & 0\\
0 & 0&m_{22} & m_{12}
}
\right]\pmatrix{x_{11}\\ x_{21}\\ x_{12}\\ x_{22}} = 0
$$
Edit: flipped minus sign into plus sign