How can a mutation in a gene lead to a new trait in an organism?

The mutated gene codes for a protein that cause a new trait