Honestly, it's just turning up to dev meetups for a year. A lot of local CEOs or CTOs will go to the meetups to try and meet new devs, as well as you meet a bunch of other devs and they'll never be resentful if you ask if there are any jobs going. Lots of companies do internal referral bonuses of a few hundred £/$/€ if an existing employee refers someone, so they're often keen to refer you!
I actually got my first client at the first meetup I ever attended with virtually the first words I said to anyone. I sat down next to someone and the conversation went, "Hi, I'm Matt, I'm a C# dev looking to start freelancing", "Oh, hi, I'm Jon, we need a C# freelancer".
Like I could list 5 local companies right now I know of off the top of my head that are always looking for devs and I personally haven't even been to a networking event for like 2 years.
I've had some great nights too, some long interesting chats. One that always sticks in my mind is someone who'd just setup his own ML cluster on AWS and him telling me all about Nick Bostrom's Superintelligence, which had just come out (wow, 4 years already). Or sometimes just having fun and a few drinks.