How Many Moves Ahead?

How many moves ahead does a grandmaster think? How does a chess player calculate or analyze? Are there ways to avoid time trouble? I’ve listed some books below that address the issues of calculation. Kotov and Dvoretsky were the pioneers. Aagaard’s publications are phenomenal and require dedication. Soltis’s books are lighter, but I consider them to be very helpful.