One question that has always come to me in the past be it far or near has been, should I specialise or generalise? Now what do I mean by these. Generalising is basically being able to learn topics on a very general level, not going too deep. For example doing studies from kindergarten until the end of your high school, that would be generalising. That is because you are asked to learn multiple subjects but none of them are so deep as to being able to actually use it at a highly complex level. For example, what you might know about an egg back then would be that it contains whites and a yolk and to have a chick grow out of it, it needs to be fertilised. Now, when it comes to specialising, you taking up a branch like science after high school would be it. It doesn’t look like much but you would be getting slightly deeper into a singular subject. When you decide that you would be a zoologist or an electrical engineer you are specialising further. Regarding the example of the egg from earlier, a zoologist might be able to tell you what exactly comprises of that single egg in details all the way from the chemicals in the shell to the yolk.
Now, what I believe after years of experience and being a student of life is that there are multiple factors to consider. Firstly when it comes to everyday life, it is necessary to learn about various topics, subjects in a generalised manner. It is good to be a well rounded person who has understanding of various things; be it simple home remedies or cooking or even fixing a bulb. But it does not have to stop at that, lots of people start with hobbies which is basically getting a bit more specialised at one or more of these generalised subjects and it is great to learn something more about various topics.
When it comes to your career, it is best to start with a slightly generalised approach, getting a good understanding about various tools of the trade that you are into, to savour various subjects what your career has to offer. For example, if you get into software engineering, you can learn a little about front end development, back end development, infrastructure setup, algorithms, structured programming etc. But as you go further in your career, it is good to learn one single thing in more detail, maybe backend development and then keeping yourself trained to a certain extent on the other topics; this sort of an approach keeps you on top of your game, it also allows you to be ahead of the competition.
In life, it is necessary to accumulate various skill sets, and that requires you to master a couple of topics, not necessarily go into deep specialisation but good understanding of the topic and then with other topics to have a good enough understanding. You can always use the principle of consistency to learn more regarding specific topics in better detail. This sets you up to be what is known as a polymath (a person who specialises in multiple subjects while having an understanding of various broad topics). Lots of masters of the past were all polymaths, such as Leonardo Da Vinci, Isaac Newton, Benjamin Franklin. They all had one or more topics that they went deep into but other topics they knew overall in a very broad sense. But more about that would be a topic for another day.
On a closing note, what I would say is that a generalised learning approach over a broad set of skills is important, but you should also go deep into some skills; how deep you go is up to you and what you need to do with that knowledge.