How to wire a switch with two black wires and one yellow wire?
This is the same as your other single pole switches except it has one extra black wire that is sending power to someplace else.
One black wire brings the power into the box and the other black is connected to it on the switch, this is how it is getting power and sending to where it needs to go. The yellow should be the switched power or the the wire that is sending power to the fixture when you flip the switch on.
Does your new switch require a neutral (white) to operate correctly?
If not then;
Just wire it up the same. If your new switch does not have screw terminals but only wire leads then you wire all the blacks together with a wire nut. You will need to tie the ground on the new switch to the screw at the back of the box that the green wires are attached to.