This can happen for a variety of reasons, even mechanical reasons.
This happened to me recently and I had not used my sewing machine for a while and had moved the machine from one room to another between uses.
The first thing to try is to change the colour of the top thread so that it is not the same as the bottom (bobbin) thread and then sew in a straight line to show you which thread is bunching up.|
I had a look at the tension numbers for the top thread and the setting was low, so all I did was wind the tension up to halfway and that fixed the problem immediately. This shows that for the beginner this bunching up of the thread can look like it is a real big problem when in reality it is something simple.
So do, first check your tension for the top thread and make sure that it is not set too low. A good guide is to go to halfway and see if that make a difference and then make fine adjustments as you go.
All the best from James Martin Sandbrook. 8th of February, 2022.