North American wiring is stuck with the colors in the pre-made cables, and are not color-co---- oh, wait. This is conduit.
Your wires are color-coded.
In your case, black is always-hot. It stops here for the switch, then goes onward to other points of use. They are using the switch itself as a splice block, which you might not be able to do with a smart switch with pigtails. Get a yellow wire-nut to splice the 2 blacks with the always-hot (probably black) from the smart switch.
Yellow is switched-hot. This goes to the (typically red?) wire on the smart switch that is intended to go to the lamp. The provided wire-nut will be fine, otherwise use a yellow or orange.
You do not have neutral in this box and you will need to use a smart switch which does not require a neutral wire. There is no way to tap the white wire passing through this box. Your best route is to change up to a smart switch that does not require neutral.
If the switch's instructions say what to do if you don't have neutral, go ahead and do that. (I suspect so given a green/white wire). If it requires you to attach it to ground, you notice there are no ground WIRES to attach to. Do not tamper with ground wires in the box. Obtain a #10-32 screw (any will do, but they sell green colored screws if you like the style) and fit it in the hole to the left of the existing ground screw. Wires to be grounded can be terminated there.
No need to wire ground to the new switch. That will happen via the mounting screws to the metal box.
If you really, really, really want neutral there...
and are willing to seriously "skill up" to get it, then you can figure out the 2 boxes that white wire is going from and to... open them up and figure out which of those runs will be easier to pull... and pull a new white wire. You can use the old white wire to pull in the new -- just lash it together with electrical tape at the "head" and at least 6" along its length.
You cannot tap the white wire as-is, because each end of it must have at least 6" of free length coming into this box, as well as come 3" beyond the wall surface... so it's about 12" shorter than it needs to be.
Read more on pulling wires into conduit before diving into this, however.