I got my foot in the door via a front-end internship in England. What I did was find free website design templates and turn them into live, working websites. This was around 2014. I then put together a portfolio, hosted it on GitHub Pages, linked it to my GitHub account, and started applying.
It was a paid internship through an EU-funded program. They made me an offer and then retracted it. But thankfully, right before the end, they were kind enough to connect me with a couple of other companies that were desperately looking for a junior dev. I'm really grateful for that because it exposed me to much more talented developers, and I learned a tonne: vim, back-end development, basic DevOps, Linux. I barely do front-end anymore.
If you're a front-end developer, it's easier because you have something to show. If you're a backend developer, you can cook up a library in whatever language you use, share it with the community, and pair it with a blog. That combination goes a long way.