TL; DR I became attracted to a particular challenging problem and just blogged and wrote about it a ton. I jumped on professional opportunities well like authoring some open source that fit in strategically or writing a book. You need not go this deep, but at a minimum you can work on identifying the people in the niche you want to focus on, network with them, find other consulting vendors, let them know you want work (they might sub to you, etc).
https://softwaredoug.com/blog/2020/12/22/hack-your-career-wi...
TL; DR I became attracted to a particular challenging problem and just blogged and wrote about it a ton. I jumped on professional opportunities well like authoring some open source that fit in strategically or writing a book. You need not go this deep, but at a minimum you can work on identifying the people in the niche you want to focus on, network with them, find other consulting vendors, let them know you want work (they might sub to you, etc).