How do I call object by its name?

Hey, normaly I call for object this way:

My question is how do I call for the object by its name ?

In the end I want to call objects in this way:

How can I achieve this?

I think we’re going to need some code for context to be able to best understand and help.