First of all, make quite sure you're threading it correctly. Threading the needle the wrong way, for example, will certainly cause tangles. Read the instruction book very carefully. If you haven't got one, see if you can find it online for your make and model of machine.
Use good quality thread. As you start sewing, place your finger on both the upper and lower threads to prevent them being drawn back.
If the problem has only just started then maybe your machine needs servicing. You can do this yourself - see https://therestartproject.org/wiki/Sewin...
If it's a fairly inexpensive modern machine and you've used it a fair bit then it may be that some of the plastic parts of the mechanism are starting to get worn, resulting in poor timing. Such machines unfortunately are not built to last. The one your grandmother had, cleaned and serviced, will probably last you as long as it lasted her!