You can use is_connected function to check before if the node is already connected:
if not is_connected("body_entered", blabla):
connect("body_entered", blabla)
But that’s strange, you’re trying to connect that inside which function? Looks like you’re using a function that’s called continuously like _process or _physics_process, things like that should be called inside functions like _ready