You CTRL+X the ones you want inside the node. Then click on the + of the node (if it's there), or rightclick and go internal. Then you see an empty space. CTRL+V and your nodes appear there. Then remember the last node (that needs to be attached to say a child input of a surface shader, or the input of a color adjust or function input of a displacement shader), go outside again, and hover or rightclick over the input you want that last, now internal node attached to, find it in the list that appears under the name of that node, and select the node name to be attached. Then the outside input triangle dissappears. If you go internal again, you'll see the last node attached to the child or so.
I'm sorry, there's no easier way to explain this, so I hope you get the gist.