How to reference an instance in the scene using c++?

Is there a way to quickly access instances using c++?
In Roblox Studio it is possible to do this:
image

image
Is it possible to do something like this in UE5?