These are what we call "silly mistakes". There is technically no specific cause for it but they mostly occur due to either trying to quickly solve the problem, negligence, or not paying attention while solving. The only thing to fix this is, well, practice.
As for the quadratic equation one, write down the values of a, b and c before solving. Like, if the question is 5x^(2) + 2x + 15 = 0, let the first line be a = 5, b = 2, c = 15. That way, while using the quadratic formula, you can directly refer this first line instead of the question itself.
I've personally followed this in questions involving multiple variables (there are formulae having a heck ton of a, b, c, a1, b1, c1, a2, b2 c2 and God know what!) as even though my Math is pretty good, I make mistakes too. So yeah, the more you take your time and write down the given stuff properly, the less likely you are to make a mistake!