It's no secret that experts that specialize in a particular niche tend to make more money. It can be easy to think of how you pick a specialization and your career takes off.
But before you can choose a specialization, you need to decide if you should specialize or how much you should specialize.
The first step is figuring out if you want to specialize.
Will you like doing the same type of work for the same industry every day?
Specialists do not have as much variety between the types of clients or projects they take on.
With the limited variety of jobs, there won't be as many job opportunities compared to the prospects for a generalist. However, the generalist also competes against many others for the job, including specialists.
Along with fewer opportunities, sometimes specialists are brought on to solve a specific problem only, leading to shorter projects. Yes, specialists can make more money for these smaller jobs than a generalist working on a long-term project.
But they need to be an expert to demand that higher rate. Waking up one day and deciding you now specialize in X won't magically make you more money. First, you have to build your experience and reputation within the specialization.
The good news about choosing to specialize is you can also decide how niche your specialization is. The more niche your specialization, the more chances you have to make money and become a top expert for a specific area. The broader you keep your specialization, the closer you are to the benefits and drawbacks of being a generalist.
It is up to you to decide just how far you may want to specialize.