One way is by recovering and analyzing the DNA from human remains. The other is to study the DNA of modern populations in order to work back to what those populations must have been like in the past.