Generally, pressure-treated (PT) lumber is the preferred choice for deck posts, beams, and joist framing. It offers good resistance to decay and insect infestation, it's widely available and it's a cheaper alternative to other rot-resistance materials such as cedar, redwood or even, composite.
All trees have two types of wood: heartwood and sapwood.
Sapwood is located towards the perimeter of the tree and carries the sap to the branches. Heartwood comes from the center of the tree and it is denser than sapwood because it is older. All parts of the tree can be used, and lumber taken from either sapwood or heartwood is graded accordingly. See picture below:
