As a verb, “founder” means “to fill with water and sink.” It is also used metaphorically of various kinds of equally catastrophic failures. In contrast, to flounder is to thrash about in the water (like a flounder), struggling to stay alive. “Flounder” is also often used metaphorically to indicate various sorts of desperate struggle. If you’re sunk, you’ve foundered. If you’re still struggling, you’re floundering.