We are in equilibrium so
We will go through these conditions one by one learning something at each step. In (1) we get that the force exerted by the wall is equal to the force of friction. In (2) we find the normal force which determines the maximum force of static friction (3).
Choose ground-ladder interface as pivot point, but you could choose any point and get the same answer. The sum of the torques must equal zero because we are in equilibrium.