A gene in coding DNA has a sequence of bases that decides the order of amino acids in a protein. The chain of amino acids folds into a particular shape, and the shape decides what the protein does. If a mutation changes an amino acid, the protein may fold into a different shape, and its activity changes.
This matters most for enzymes. An enzyme works because its active site has a shape that the substrate fits into. If a mutation changes the amino acids at or near the active site, the substrate may no longer fit. The enzyme then works more slowly or not at all, and the phenotype changes.
A variant in non-coding DNA does not change the structure of a protein. Instead it can change how genes are expressed, meaning whether a gene is switched on and how much protein is made. If a mutation stops transcription of a gene, no mRNA is made and so the protein cannot be made at all.