If the object you want was created in the GUI you can set other_object using it's node path, for example
other_object = $a_child_object
other_object = $"../a_peer_object"
other_object = $/root/World/somewhere_else/in_the_node_tree/object
etc
Or, if other_object was created in a script you would create it and store a reference to the new object, something like this
other_object = BadGuy.instance()
Or you can find a node using methods such as get_child or Groups etc
This is one of the most important (and potentially confusing) things you need to understand to get started with Godot - you will use this ALL the time when writing in Godot. I recommend you take a bit of time to watch some of the tutorials about this, for example this one is nice