Quite literally: when interviewing, just ask for significantly more than you make. Like, 10-20% more.

My background: I'm somewhere around the 20 years of experience mark, a bit more than a quarter of that as a dev at a FAANG, a bit less than a quarter of that as a hiring manager / senior executive for startups (in one case, nearly quadrupling the number of devs in my org in a year; in another, managing a 4-5 dozen devs org).

The ideal situation is looking for a job while you have one that you are at least mostly-happy with. Or at least one where you can stay for at least another few months still -- in case you don't get the offers you want. And have a honest idea of how much you should or want to make. Ideal scenario is having close and honest friends that are peers (or even better: hiring managers) in your domain that you are comfortable talking money with.

Go through those companies in some order (most excited to least excited if you're in a hurry, least excited to most excited if you want to get the best offer possible) and interview at 1-2 at the same time, in order. Pass the interview at least up to the point where you're talking salary. In my experience, it's rarely upfront, which is an annoying waste of time if the candidate and company are on totally different planets regarding salary expectations, but having been a hiring manager, I get it [1].

Then get offers, or not. As hard as you can without pissing the company off (pissing off a hiring manager is harder than most people think, just be at least somewhat nice and reasonable about the whole thing) -- make sure to skip over HR and talk straight to the hiring manager, before and after the interview [2]. Preferably, ask to book the post-interview meeting during your pre-interview chat, so the hiring manager has extra peer pressure to actually show up "in person" (well, on the phone). Bonus points for reaching out to a senior director or (for a small enough company) a C-level executive on LinkedIn.

If you get all offers, you probably are asking less than you should. No offers, much more. 50/50? You're asking just the right amount. Not all refusals are salary-related, but for now, companies can't afford to be too choosy, so overall, market bias should be on your side. It's a time consuming process, but for a lot of people, frankly there's a 10-20% salary hike on the line every few years -- how much time is that worth to you? And don't feel bad for the "poor hiring managers" whose offers you do not accept in the end [3]. Keep in mind most of the advice on the internet is from recruiters and hiring managers that have a vested interested in candidates not shopping around (for a tangentially related topic, read https://en.wikipedia.org/wiki/High-Tech_Employee_Antitrust_L... and think about this topic, hard).

Finally, do this every year or two, even if you have no intention of leaving your current place. First, it'll leave a trail of companies (and hiring managers, that may go to a company you're a better fit for) knowing your name and wistfully thinking about the great candidate that got away. And second, it's a great thing to know exactly your worth on the market. I know folks who've doubled their income in less than five years this way.

To be fair, there's the (I believe very small) chance that your current employer will hear about your shenanigans -- and that could bite you in the ass in the (very) short term. Personally, I've never seen that, either as a candidate or hiring manager and for me personally, the risk is 100% worth it. Caveat lector.

[1] When I hired, I usually had 5-6 roles opened in my budget, and if your interview process proves to me you're a talented but more junior candidate than I hoped for, I might compromise but offer you below the bracket I was thinking about and raise the experience bar for the next hire. I usually have some kind of wiggle room of that nature, wiggle room which mostly disappears if I told you the expected salary bracket upfront.

[2] Admittedly, this is significantly easier at smaller company, where a formal HR is oftentimes just not there yet. You'll get significantly better feedback straight from the horse's mouth, including fun statements like "your salary expectation just doesn't fit in my budget"; though that either means you really asked for more than I can afford, or you did not convince me you're worth that much.

[3] First, they did a poor job convincing you to work for them and that's explicitly their job during the interview process, whether they know it or not. And second, if the company they hire for is any good, they usually only hire an absolute maximum of 30% of the candidates they interview (usually, much, much less: that FAANG I mentioned way earlier? more like 5%). If they can be choosy, why can't you be? Plus, I remember most of the candidates that I made offers to and said no to me. Not because I'm annoyed at them, but rather (until I left my hiring manager position) because I followed them on social media just in case they said something about their current job being a PITA or otherwise hint they might be looking. Telling a company no is a great way to leave a reputation of being better than they thought, and the good ones will not forget and keep the finger on the offer trigger. Keep in mind the good hiring managers also have a reputation they want to preserve, if they're even half thinking about their own career prospects...