I'll play a bit of the devil's advocate here.
How to properly let it go how coworkers around me are performing, when they do not affect my job and I do not have a manager position?
You're wrong here, three times in a single statement. Stop lying to yourself. They do. They already did affect your job. You think about them, you care about them (even if in the negative sense), and you are preoccupied with their behaviour. That affects your work, and will/would affect it in the future. You most probably won't be able to let it go - human nature doesn't work that way. Lastly, you do have a manager position - you can manage your own life.
tl;dr either learn to SNIP (smile, nod, ignore, proceed), or change your job, ASAP. FWIW, you're probably better off changing your job. You're already too deep in this, mate, if you're asking random strangers on the internet for help ¯\_(ツ)_/¯
... don't get offended, keep reading if you can - because I was in your situation in my last job. A long story follows, with a moral lesson at the very end. Some details were changed, to protect the innocent - but since no-one is completely innocent, most of the story is real.
My team consisted of team lead, tech lead mixed front/back dev, devops guy, front end dev, and me, as a backend dev. We worked in open space office, with about 6 other teams around.
Mind me, not only most of my team was slacking off; almost the entire office was slacking off routinely (about 1/3 of the people theoretically present in the office were either in the console game room, additional game room, kitchen, nearby restaurants or in the conference rooms, doing stuff barely tangential to their jobs; there were only a couple of guys who actually spend at least 6h a day coding - also, many of the people were talking small talk for literal hours instead of working). As far as my team was concerned: team lead worked for about an hour a day, and was barely skilled enough to code or design at all (no previous work experience, master's degree in unrelated field etc.), front end dev worked sluggishly even on the simplest features and delivered them with lousy coding, devops was shared with another teams so sometimes he actually worked only for an hour or two on our project (quite big BTW, a bunch of webpages with 100s of thousands of user visits per day), and tech lead guy, while a great programmer, was either sitting in the kitchen area with the team lead, or off the office eating, or playing squash etc. Our code base was ancient and we have had several severe problems with our 3rd party suppliers. We had a couple of years (literally) of technological debt accumulated. I asked about it, and they told me it's, quote, maintaining a healthy work-life balance.
"Maintaining work-life balance when you're at work", I asked myself?
I was new there, and that whole situation was a bit disturbing to me, to say the least. I reacted doing what I could best in this situation;
I wrote code.
Sometimes I took some unpaid overtime when nobody noticed (so that nobody would frown upon me not maintaining the "balance", heh). Sometimes I went home earlier because I couldn't work with people constantly chatting about bullsh*t just up my head for literal hours. Sometimes, seldom, I worked from home (my neighbours were refurbishing their flat, so it wasn't the best option at that time).
Three months have passed.
I reduced the tech debt a bit, I've introduced some new procedures and innovations that helped the team, I worked closely with all the people in the team. The team lead said he noticed how much effort was put by me and how the code went forward; I got a praise and was told I will get a junior dev as a helper and that I'll get promoted if I'll maintain my performance for another three months. I was told to do what I can to bring the project up to speed.
Other people were still slacking off, as usual.
Another three months have passed.
The tech debt got severely reduced, we migrated a lot of old stuff, I routinely finished as many tickets in a sprint as the entire rest of the team, I got the promised junior dev as a helper (a colleague of mine from previous job I referred for this position, to be precise), and I was told by our team lead that I'll get promoted as soon as possible, and that I should extend my performance even further by doing mentoring, tech talks and knowledge sharing and documenting it (which I actually did) so that it'll be easy to provide HR with proper paperwork for the promotion.
Another three months have passed.
The new junior dev was doing great work, the tech debt got reduced, we blah blah blah.
It didn't matter to me anymore. I was tired, frustrated, got some sick leaves due to upper respiratory tract infections due to crappy AC in the office, I started having problems with sleep... and I finally snapped. On one of the sprint plannings, on which the junior dev was absent, I got berated by the team lead for, quote, doing stuff I wasn't supposed to do (fixing invalid labels on tickets in Jira, to be precise) - only after I was explicitly told I can freely do those things and should do them as I see fit by the very same team lead a couple of weeks earlier, and to which I had full credentials in the system. Nobody questioned the validity of the changes I did. Nobody questioned the usefulness of the changes. I was just told "You shouldn't have done that. You did too much." by the team lead. Like I said, I snapped. I didn't yell - I just angrily asked "If I didn't do it, nobody would do it, because nobody in this room apart from me cares about this project at all", to which the team lead responded, smirking "Nobody told you to do it, it's your fault and you will pay for it."
I took sick leave due to increasing health problems. When I returned, I got called to a couple of HR talks with office manager etc. about how I was reported by my team lead to be a disruptive employee, and that a "recovery programme" is being developed for me. I got presented with a written disciplinary action proposal, being basically a forced "confession" about how I destroyed both the team, the team spirit & the project and that I take full responsibility for it, and was asked to sign it.
Luckily for me (though I wouldn't call it just "luck" but rather "tedious preparation"), I got all the team comms and messages CCed, I got the repos cloned with commit history and with code metrics showing clearly how much code was authored by each and every person in team, I had analytics from issue tracker showing task completion rates and ratios by person, I had all the dirty-ish info & evidence on team's members breaches of conduct (alcohol & drugs taken in the office, sex in the office etc.) - also, I learned something in the meantime: my progress was reported as the progress of the tech lead guy, with which the team lead had a romance. I was never really considered for promotion by no-one; I was meant as his backup, in case his fiancee finds out and he's forced to quit... that would be the only case in which I'd get "promoted". I told the head HR representative I won't sign the documents, that I have a complete evidence proving this is a set up, I showed and explained some of the evidence, and I said that the best that they can expect from me is that I won't sue for mobbing and keep my mouth shut about the whole issue, if they retract their accusations. HR head told me they will get back to me as soon as they verify the information I gave them.
They never did.
I got no disciplinary action, I got no "recovery programme", I didn't receive a notice... I got no response at all.
Month later, tech lead guy resigned.
After snooping around, I heard that he was actually presented with an ultimatum - either he resigns, or he gets fired for misconduct. I don't know if that was what actually happened. I think it was. The slot was now free, and I was eligible for promotion, which I knew I'd never get after what happened. At the same time, team leader took a step back from me and we only shared "good morning" and "bye" from that time on.
The next week, I resigned. I went home, opened a beer, sat in an armchair, and exhaled deeply.
A month has passed. My respiratory tract is still infected, but it's getting better slowly. I'm still tired and frustrated a bit. I still have trouble sleeping (it's 5am here where I'm writing this). I'm still not happy - but I'm getting happier by the day. So, if by the virtue of my knowledge I can share something with you -
don't do this to yourself.
Either stop giving a sh*t right now, ASAP, and never think about those other people again - or resign. Maybe your company will get better. Maybe those people are really working very hard. Maybe you're just overreacting, or maybe you're the one who's slacking off. It doesn't matter. What matters here is your happiness. Currently, you're unhappy, and that's a fact here. It will only spiral down, not up. You already started dwelling on it; your emotions were a sign of the problem
outside of you, but right now they are a problem
inside of you.
If I were you, I wouldn't take any chances. You've only got one life - live it so that you won't regret it. You can always get another job. You can't get another life.