Connect with them on the LinkedIn desktop web app and include a personal note how you’re interested in the role.
I have had a lot of success-maybe something like 30%+ interviews from the cold outreach.
Worth noting I was targeting early stage startups who are more likely to engage with any interested candidate. These folks are also more motivated to talk with you - they are literally posting hoping that it will happen.
For more mature companies apply through LinkedIn was actually fruitful for me too, but I had to be eagerly watching and ready to apply within the first few hours of posting.
You can also toggle on that you’re looking for a new job and recruiters should ping you if you have the right stuff in your profile - which is really just “software engineer” and use the keywords.
Good luck!