Is there a reason you tagged it with matter? Do you expect it to be matter functionality? This would not depend on the protocol involved, would it?
You’d create an automation, but what it would look like depends on how you intend to start the timeout. Should it be universal, always, or just when started a certain way? Are there circumstances where the action should not happen, or the delay be extended? Concrete examples work beter than generic questions, because there are no generic answers for most things.
As for the way to do it: timer entities would work for longer delays, you could also set an input helper with the desired time to have something done. Shorter pauses could use a delay, but they get cancelled when automations reload. A for statement in a trigger is also always good.
Here’s a simple example of a motion controlled light with a 2 minute delay for off: