Its a matter of luck also. I suggest you invest in real word projects doing pro-bono work. That's how I got my first job.
I would suggest you look here as there are lots of opportunities:
I would also suggest putting any coding challenges you can on GitHub to enhance your application.
You can try also freecodecamp.org/ certifications as they give you lots of support and portfolio.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.