Decision problem for a Regular Langauge
Your algorithm is not really specified completely, since you don't explain how you choose the word $w$. However, even once you do specify how $w$ is chosen, your algorithm will be incorrect. The reason is that it is completely symmetric in $M_1$ and $M_2$. In other words, if the algorithm accepts on the pair $(M_1,M_2)$, then it will also accept on the pair $(M_2,M_1)$. This means that it will necessarily fail for machines satisfying $L(M_1) \subseteq L(M_2)$ but $L(M_2) \nsubseteq L(M_1)$.
Presumably in class you were shown other decision algorithms for regular languages. I suggest you try to emulate them. As an example, here is an algorithm that determines whether $L(M) \neq \emptyset$, for a DFA $M$.

Input: A DFA $M = \langle \Sigma, Q, q_0, F, \delta \rangle$.
Accept if some state in $F$ is reachable from $q_0$, and reject otherwise.

(In class you will probably need to be more verbose.)
To show that this algorithm is valid, we need to show two things:

If $L(M) \neq \emptyset$, then the algorithm accepts.
If $L(M) = \emptyset$, then the algorithm rejects.

To prove the first part, suppose that $w \in L(M)$. By definition, the state $\delta(q_0,w) \in F$ is reachable from $q_0$, so the algorithm accepts.
To prove the second part, we will prove the contrapositive: if the algorithm accepts, then $L(M) \neq \emptyset$. Suppose that some state $q \in F$ is reachable from $q_0$. This means that there is some path from $q_0$ to $q$. If $w$ is the concatenation of all symbols on this path, then $\delta(q_0,w) = q \in F$, and so $w \in L(M)$, showing that $L(M)$ is non-empty.
(Once again, in class you will probably need to be more verbose.)