2D game object trigger

I’m trying to get objects to react in some way when other (collider) triggers collide with them. I know how to do something to the object when it first touches the trigger, but how could I get it to do something when it stops touching it? I think I may be able to do it with OnTriggerExit, but I don’t have a good understanding of triggers.

try OnTriggerExit2D()