I mean, it's what it says on the tin: linguists go into remote areas and take recordings of dying languages to preserve them. They'll sometimes prompt for specific words and sentences, other times just record people speaking naturally. Then they'll also write down the rules of the grammar and the vocabulary (another example of using a medium they may not themselves have).