Remove a node in the material / node editor

# node is of type bpy.types.Node
node_tree.nodes.remove(node)

Link an input and an output

Assuming you have two nodes left_node and right_node.
output and input can be indices or strings.
For example, on a Diffuse BSDF node you can access the output by node.outputs["BSDF"] or by node.outputs[0].