Why? Well, because this and this are the same expressions, because they both equal the same thing. Namely change in Gibbs free energy. So let's set these guys equal. So we get negative MF times E equals negative RT, notch and log of K.
So we can basically rearrange this guy and solve for our cell voltage. And what we get is the negatives cancel and we bring the M and the F to this side.