I had experience working with small law firms, also easy to find online. Law offices always have computers and computer problems so I started calling, told receptionist I was with Dell support and needed to speak with their IT manager about an upgrade. Very often they outsource that so I’d get the name of their support firm and then call offering to take on overflow. Got some good leads that way.
I also talked to everyone I knew and had previously worked with to let them know I was looking for freelance work.
You have to do some work drumming up business. I had worked in sales support earlier in my career so I knew something about how sales people find prospects and cold call.
I didn’t focus on any specific language or “stack,” only on finding business problems I could solve.
https://typicalprogrammer.com/how-to-start-freelancing-and-g...
Something to keep in mind: When I talk to potential customers the one thing I hear over and over, from almost every one of them: The last person/company who did programming/IT work ignored their emails and phone calls. Don't do that. Commit to acknowledging emails and taking phone calls. I tell my customers to email unless they have a dire emergency and always reply right away.
Another thing I heard a lot -- probably because I focused on taking over legacy/abandoned code: The previous developers didn't listen to our needs, gave us something that almost works, then demanded more money so we ended the relationship. Lesson: Propose and estimate small tasks that you can define and describe in terms of deliverables, so the customer sees progress all the time and you aren't haggling over how many hours you spent.
I got laid off (company went bust) back in 2009 and started freelancing. I got some referrals from friends and just kept going. I found plenty of work, mostly word of mouth and with long-term relationships with customers.
I never had much trouble finding customers. I focus on solving business problems. I prefer working on legacy code (which more often means “abandoned” rather than “old”). I don’t specialize in any particular stack or technology, I figure out how to fix things.
I used to get quite a bit of overflow work from software dev shops and design/marketing agencies. They either need work or they have done the prospecting and give an intro. If I had to start over that’s where I would start.
In 2014 I signed up with an agency to represent me. They do marketing, legal, customer service, invoicing, payment. I have found that worth their percentage because they built a premium brand that benefits me.
I have some articles about freelancing on my web site, link in profile.