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.