Deconstructing an object

How would i make a custom node that recives some
{ name: "Hello" }
and gives back only the name. Like msg.payload.name
I tried writing it like that but it gives back undefined

Please read the node red docs on creating nodes, that will give you a good introduction on how to do it.
When you have read and understood that, if it still doesn't work then put your node in a repository on github and give us a link to it, then we can look at it and install it if we wish. Do not publish it to npm though.

Understood. 1 more question tho. Can i somehow make global.set("LeadPump", msg.payload.value);
inside my javascript file of custom node?

Why are you updating global context from inside a custom node?

This can (will) lead to issues with peoples installation of node-red.

Unless there is a very good reason - do NOT update flow or global context from your custom node - instead, pass the values out of your node and the user can set flow/global context.

Im just testing something and need this to make it work. This wont be published on node-red. Just a practice.

In that case test it and see what happens.

dont know how to give set the global context
should be like this let globalContext = this.context().global; globalContext.set("Pressure1", msg.payload)

You can always learn a lot of basic things by looking at existing nodes from other developers. E.g. here.