How do I stop or cancel a task run?

From flow code you could do:

But we don’t have a feature to cancel a run from the UI. And even if we would, this would allow canceling a flow run, not a task run. Does it answer your question?