It is better to use a variable because if the node path will change as you continue working on your project you'd have to go through every
$ChildNode and change it to the new path. If you use a var, you'd just have to change the path in the var declaration.
But the best way to do it is to right click on the child and press "access as scene unique name". that way you can access the child by its name, and it will persist even if you move it up or down the tree.
Here's an example of using a scene unique name to reference a sprite:
var child = $'%Sprite2D'