Tuning the valley and chiral quantum state of Dirac electrons in van der Waals heterostructures