How to block functions on layers lower than a button when clicking on the button

I have downloaded ARkit plugin. In one of the examples provided, the user can move object to the position they touched on the screen. I added a button on the canvas to realize some functions. But when I click on the button, the object will move to the button position as well. The object should remain its position when clicking on the button and change its position when clicking on area other than the button. How to achieve that??

I have tried physics and layer already but no effect.

It’s probably not for every situation but I have recently done the following to map out areas that I want to place buttons and not allow interaction in those regions. In my code I just put an IF statement to check if the player is allowed to interact with the area below the button.

    bool InteractiveArea(Vector2 _pos) {
        //_pos is the position clicked/touched
        // set it to true by default
        bool result = true;
        // this protects my buttons on the right side of the screen
        if(_pos.x > (Screen.width - 200)) {
            result = false;
        }
        // this protects my buttons in the bottom left of my screen
        if(_pos.x < 180 && _pos.y < 80) {
            result = false;
        }
        return result;
    }