Use interfaces as clear contracts between systems.

public interface IInteractable
{
    void Interact();
}

Raycast example:

if (hit.collider.TryGetComponent<IInteractable>(
    out IInteractable interactable))
{
    interactable.Interact();
}

The interaction system does not need to know the concrete object class.