gm techniques – How to lessen the party’s bad choices?

Not too long ago I started a campaign in Pathfinder 2e, and at a certain point I hinted at an enemy group’s location and (superior) strength, while telling the party to go somewhere else and complete an objective. It was just foreshadowing, but the players went and tried to fight this group anyway, resulting not in a TPK (enemies are not interested in that, yet) but in the capture of the party. I will make the party escape, although with basically random equipment that they will recover while fleeing. But I’m sure they will do something like this again, because most of them do not think before they act. What can I do to lessen their bad choices aside telling them directly out of game?