This is somewhat complicated because many "traits" are comprised of several different genes. The basic flow of information is
DNA ------>RNA----->protein
DNA contains the "instructions" for building proteins.
A copy or "transcript" of the DNA is transferred to an RNA molecule
The RNA molecule is read and translated by the ribosome into an amino acid sequence which will then be folded into a particular shape to make a protein.
Several proteins combine to form protein complexes which perform functions within the organism. The shapes of the proteins are determined by the DNA sequence. The shape of the protein changes its function and ability to interact with other proteins and cell components. Protein shapes and interactions are the basis of genetic traits.
A simple example might be a strain of bacteria that is resistant to anti-biotic. A bacterial strain of this type might include a DNA sequence which changes the shape of a protein making the anti-biotic unable to interact with it in the same way. In this way, the bacteria are expressing resistance to the anti-biotic.