This problem can be very annoying if it occurs several hours after you have started printing.
Be familiar with the material you are using
Some materials have a lower elongation at break than others, which means they break more easily. Almost all carbon fiber blends break extremely easily and require the use of a Teflon-PTFE tube to guide the filament and prevent breakage during printing.
Generally speaking, the use of a Teflon tube to guide the filament to the extruder prevents the filament from breaking or tangling.
PLA has a much lower elongation at break than ABS, so you'll see breakage more frequently in your PLA prints. You can test this yourself: it's easy to break a small piece of PLA on its spool by hand, whereas ABS requires a cutting tool.
A 3mm filament is also much more likely to break than a 1.75mm filament. So 3mm (or rather 2.85mm) PLA at the end of the spool is almost impossible to print without it breaking, unlike thinner diameters.
Store your filament carefully
Depending on the climate in your area and the material you are using, improper storage of filament can lead to poor printing or breakage. This is the most common cause of filament breakage, yet it's fairly simple to avoid: if you don't plan to use your spool of filament for a week or more, simply store it in an appropriate environment.
Store the open filament in a closed environment with a dehumidifier, or vacuum seal it with a desiccant bag. The dehumidifier should be set as low as possible (normally around 20%), especially if you live in an area with high humidity.
This storage is very important for nylon filaments, as they can easily absorb moisture within hours of being exposed to a very humid environment. Be aware that there are filament storage and feeding systems that keep the humidity low: these systems are especially useful for highly hygroscopic materials like nylons.
If you have not stored your filament properly, then you will need to follow a series of steps to remove the moisture or purchase a new spool.
Don't hesitate to change filament manufacturers
If your filament manufacturer doesn't have good , you will probably encounter this breakage problem often. So it's best to spend a little more on a brand with a better reputation: Hatchbox, E-Sun, Polymaker, MatterHackers, ColorFabb, IC3D, taulman3D, AIO Robotics, Overture and Proto-Pasta are just a few of the filament suppliers that shouldn't be an issue.
Loosen the sprocket tension
The tension on your extruder's sprocket can pinch the filament too tight. Rubbing the filament can then cause the material to break completely. More commonly, it can cause the filament to strip and even break.
Most extruder setups allow for adjustment of this tension: it needs to be tight enough that there is a lot of pressure, but not so tight that the filament will deform. Try loosening the tension a little if you think it is too tight.
Check the nozzle for obstructions
If your filament breaks, it may be due to a clogged nozzle.
In summary
Switch to a 1.75mm extruder and an extruder head configuration that has less closely spaced notches for the filament.
Store your filament carefully. Using old or poorly stored material is the most common cause of this breakage problem.
Always purchase your 3D printing filament from a reputable manufacturer.
Replace your spool and test a new manufacturer if necessary.
Check that the nozzle is not clogged and unclog it if not.
These tips are taken from the book RΓ©ussir ses impressions 3D by Sean Aranda (Eyrolles), which reviews all the problems encountered in 3D printing and provides solutions to solve them. Indeed, no matter what model of desktop 3D printer you have, no one is safe from a failed part. So to stop fumbling with 3D printing and wasting filament, you can order this book here.