onready is just syntax sugar, in Godot 3.X you have to do this manually by putting your code to _Ready
method of you node:
public Node node;
public override void _Ready()
{
node = GetChild<Node>("my/path/to/node");
}
There is a better way of importing nodes in Mono in Godot 4. You can simply export Node and drag and drop it using GUI. Then it will be available even before _Ready()
is called.
[Export]
public Node node;
You can try this example in Godot 3.X, but I' not sure if this feature was cherry-picked to 3.X branch.