"Telling someone that something is impossible" is a good habit to unlearn. It's easy to find reasons why something cannot work; much harder to find ways in which it *can*, and insisting that it cannot will do nothing but demotivate people and sap away energy that could have been spent on finding solutions you weren't aware of.
There's one exception: if you are very experienced in a topic, and you feel that someone is underestimating the difficulty of something (especially if it's common for people to do that); it can be worth warning someone about it. But if they indicate that they understand this, you need to take a step back.
@joepie91 (and for the latter case, it's more helpful to explain why something is more difficult than it seems, so someone who wants to go ahead anyways knows what to watch out for)
like, "okay. this is a hard problem. generally things fail because they don't consider X, Y, Z"
which then leaves room for "oh i have a solution to X"