How did Spain take over Mexico?

they used nail polish. just kidding! They used troops and fought against mexico.