Installing Light Switch
I've never connected a motion switch before but it looks like the two whites neutrals in the wall box stay together, and then just twist one of the two blacks coming out the wall box each and individually with one of the blacks coming off the switch (just pick one from wall to twist with wire nut with one on the switch, and then do the other blacks). The green and the other small wire are ground wires so those will go from a newly connected pigtail to the metal box, and follow instructions from the Important Grounding Note section below for correctly connecting the grounds.

Important Grounding Note: You should use pigtails to connect the two grounding conductors to the circuit grounding conductors, and the box. Putting them all under the same screw, is not the proper way to do it.