Hi Isha,
Please check the following documentation about the Delete Object(s) activity:
https://docs.mendix.com/refguide/deleting-objects/#delete-example
You can set a prevention of the delete action if the object is being used by another object in an association, this way if the object is being used in the association it will show the message. Otherwise, the object is deleted.
If that solves your question please mark it as solved, best regards!