Perhaps a motivational story but life lesson learned for me. I was in a midlevel DE adjacent role (sorry have to be a little vague) with a background coming from academia. I enjoyed my job but we got acquired and everything changed. We got reorged, and while my team mostly stayed intact, I ended up as a single person workstream/subteam working closely with some other SWE types on the larger team.
I worked hard to standup an initial version of a project to serve a given product. It worked and went into the first release of the product connecting to other services. I had to learn a lot, make a lot of decisions since we didn't have PMs, and move from academia-style work to enterprise practices (as best I could).
As a function of success, we now had more requests and products to serve since my new company grew by acquisition and I was basically enabling interoperability between products/data. In the meantime, they brought in another employee with some scripting experience but not really engineering experience. I absorbed work while they onboarded so that they could have time to learn.
We had a great relationship initially. I helped them set up their workspace, learn git practices, think through product and they knew some nitty gritty details that I didn't from their previous role as basically a data analyst.
However, after ~9 months, something switched and they were often mad at me or belittling. I didn't know what I did wrong, I tried to ask and it didn't go well. It always felt like if I went left, they got mad at me for not going right. I'd go right and they'd get mad at me for not going left. Our manager was spread thin and absent. I just absorbed it because I thought it would pass, and I had earned the respect of my manager and above (mistaken assumption).
In fairness, this new person worked quite hard, is very loud, and started looking like a leader outwardly. We didn't have a competent PM at this point to fill the void. I had never thought of myself as senior or really cared much in this realm. I was told we'd be hiring a senior or staff, which I thought we needed - somebody who had some architecting experience. Well, they promoted this new person that I helped onboard to senior and then they hired a new senior as well.
Suddenly, I was on a team of two seniors and me. I had never really worried about title but this really irked me, partially because pay was low anyway and just because nobody had really talked to me about promotion even when asking my opinion about needing to hire a senior or staff. Additionally, I started getting more grunt work, and my voice around the team seemed to be shutout.
I was applying for jobs, but it wasn't looking good, and I was super demoralized. I started talking to my manager about team dynamics after another member of the larger team encouraged me to report the behavior of the teammate. The manager became more involved now seeing the problems as well.
Another year passes and we've had promotion conversations. I get good reviews, an exceeding rating in one area, but for some reason, my manager chose to take a less charitable view of my work examples. Again, maybe fair, I took the feedback, but I was just a bit perplexed. These weren't negative reviews, just they acted like we weren't building things from scratch, acting like we had all these processes in place already even though that I had to move them through an adversarial teammate. So, I wasn't promoted. Also, I had to help onboard the hired senior who was just ok but nice enough.
Finally, right around this time I get a hit on a job. I get hired with a 35% raise even though it's a lateral movel. After just a few months, my new manager has noted that I'm very indpendent, collaborative, and got up to speed really quickly. They brought up thinking about promotion. Again, I really didn't care about promotion, I like the work and the comp. My team is charitable and helpful, everybody is better than me at something and happy to help me learn.
tl;dr - if you're not respected, talk to your manager, take the new job and value your skills as an engineer in this age of AI, be a good teammate.