How do I detect if there's an object at the same position and destroy ONLY ONE of them?

Detecting if there’s another one is easy - simply use raycast or triggers.

But now I want to destroy only one of them.

If I just use Destroy(collider.gameObject) etc. it will ultimately destroy both…

Any ideas?

Add a boolean condition to check if 2 of the game objects exists. Then add the destroy function that only triggers if there are 2 objects and make sure that there is no object destruction if only 1 of the object exists.