First, a caution about expectations. Switches do not use neutral, and many switches do not have neutral which means they cannot be tapped for power for outlets or onward circuits. So generally don't look at a switch and "expect" to tap power from there. It often won't work out. "Where do I get a neutral for my smart switch" is our #1 switch question and the answers usually are not pretty.
Now let's talk about those "unrelated" wires. Like I said, switches don't use neutral, so one guess what those wires are lol. So they seem to annoy you, but they actually make your project possible. "Thanks, fate!"
If you've googled common switch diagrams, you have "power to the switch" with an asterisk: Power (always-hot, that is) also continues PAST the switch, PAST the light and onward to other points of use. (or possibly the reverse; power may come from the light's direction and continue past the switch to other points of use; either way it won't affect the wiring.) So now we have the definition of all these wires, and a preferred color scheme.
- 1 and 2, tied together, are always-hot coming from the supply and onward to other points of use (pref. black).
- 3 is switched-hot to the lamp. (pref. red).
- The two little wires in the back are neutral (mandatory white or gray).
Your new switch will have 3 terminals: Always-hot (common; do not separate), switched-hot, and neutral (silver screw).
Code requires that each wire have 6" beyond the end of the pipe and 3" beyond the surface of the wall. You will need to use splices to extend some of these wires. I recommend using #12 THHN wires of appropriate colors (any better hardware store, i.e. not big-box, cheerfully sells those for a quarter a foot). I personally prefer stranded, however stranded is forbidden in backstabs and requires skill on side screws (if it mashes into a mess that is wrong). If you buy better quality devices they use "Screw-and-clamp" which wires in the back but clamps down with the screw (torque HARD or to the stated spec). That said, I recommend solid wire for novices as it's just easier to work with.
Note that you need to establish that this location has proper grounding. If it doesn't, you will need to use a GFCI outlet, which they do make in that switch+outlet style. The switch will have 2 black pigtail wires; mark one RED. Here's the important thing in that case: Do NOT use the "Load" terminals at all or this configuration will be very messy. Don't even peel the warning tape! Read the instructions for how to connect 2 wires under 1 screw (the screw-and-clamp scheme I mentioned) and pile everything on LINE.
You can also use a GFCI breaker, outlet or deadfront between panel and this location, to protect the whole downline circuit - in that case you would use Load. However having a light on GFCI is not great - you trip the GFCI and now you are in the dark holding a hot curler, soldering iron, or fingers 3 inches from a still-spinning saw blade. No fun. Lights on GFCI are only required if they are inside shower stalls.