How do I script a connection between two nodes?

I am trying to write a script that will connect an image to the surface texture of a material but it seems that the ways I have found to do that are outdated. I keep getting this error:

raise ValueError("1-2 args execution context is supported")

ValueError: 1-2 args execution context is supported

#uses nodes
skin.use_nodes = True
nodes = skin.node_tree.nodes

nodes
image = nodes.new(type=“ShaderNodeTexImage”)
output = nodes.get(‘Material Output’)
#print(image.outputs[0])

bpy.ops.node.link_make(image.outputs[0], output.inputs[0])

principled_bsdf = nodes.get(“Principled BSDF”)

if principled_bsdf:
nodes.remove(principled_bsdf)

emphasized text

First, don’t use bpy.ops unless they are unavoidable.

Create the link directly in the nodetree.

skin.node_tree.links.new(image.outputs[0], output.inputs[0])