If $X$ is irreducible, then any open subset is dense, and since $X$ can be covered by open affines, any one of these will do. If $X$ isn't irreducible, take an affine dense subvariety of each component, and take their union.
Edited to add: As commenters have noted, you'll want to be sure the affine dense subvarieties you choose are disjoint from one another (in order to insure that their union is affine). But this is easy: For each of these subvarities, just throw away all its intersections with the other components, then take an affine open subvariety of what remains.