These diuretics work by blocking sodium channels in the kidneys or by antagonizing aldosterone receptors. This action leads to decreased sodium reabsorption, thereby increasing sodium and water excretion. By sparing potassium, they help maintain electrolyte balance.