How to render object in front of everything else? I want the robot arm to always be fully visible in front when rendered (and preferably while working in the viewport, too).
So the tree should never overlap the robot in the final image, even if the robot is technically inside the tree.
How can I achieve this (in the easiest way possible)?
Create two scenes, one with the tree only and the other with the robot only.

The robot scene should have a transparent background (Select Film Transparent in the Rendering Properties menu).

In the Compositor mix the two scenes using the alpha of the robot scene as mix factor.