Adding to the other answers here, also helps to develop mathematical common sense.
For instance - if the question asks you to find a solution to an equation, then when you get your answer, try feeding it back into the original equation. If it doesn't actually solve it, then you've gone wrong somewhere. While if it does solve it, you don't need anyone to mark it for you - you know you got it right (though it might have more than one solution).
In other situations, before you start, you may be able to see right away - something about the solution - for instance - a rough idea of the size of it.
Even very rough - that it is, say, between 10 and 100, or less than 1000 or whatever, that can help avoid making really absurd errors that beginners at maths can make so easily. And - no matter how complex the problem, often you can get a rough idea.
E.g. suppose you are evaluating some complex integral between 0 and 1 for a positive valued function that never takes a value more than 1 in that range, then it's area can't possibly be more than the area of a unit square - so if you get an answer greater than 1 you've made a mistake.
Just takes a second or two to do this. And typical errors in maths are often things like forgetting to divide by something, or multiplying twice or whatever - can often lead to an answer that is out by orders of magnitude. Not going to detect all the problems of course, maybe not as many as half of them, but it's so easy to do and in the cases where it does work, it helps you avoid answers that seem absurdly wrong for anyone looking at it with a bit of mathematical nounce.
But - if you are stuck in the sense - of not knowing what to do at all, not just mistake, then - it's a case of trying to identify what you need to understand.
Do you understand the question or problem? Are there any terms you don't know? If you don't understand the question then there is no chance of solving it and guessing what it means is likely to lead you astray in maths
Bit of a tendency to kind of stare at the words and hope they will make sense. But they won't, it's not like poetry, where the context may help you understand the word better, chances are if it's an important word or concept in the problem and you don't know it, you simply have no way of knowing what the question is about.
So find out if you can. In exam conditions, leave it to the end in case you remember what it means.
If you do understand it, do you know of a technique you can use to solve it?
If not exactly the same, does it resemble something you know how to solve? Might there be some way to re-arrange it or look at it in another way?
If you can't solve it and don't know how to solve it - and after you try re-arranging it - well - it might just be that it's something you haven't learnt yet. Or forgotten.
E.g. suppose you need to solve a cubic equation (or a quadratic) but haven't learnt how to do that yet. Then - well it took clever mathematicians many centuries to find out how to solve polynomial equations.
We've got a head start on them today because our notation is far simpler. Also, we are comfortable with negative numbers (in the past they used to rewrite polynomial equations to avoid any use of negative numbers before solving them, and split them into many different cases when we see it as just one case) - but even so - unless you are a really brilliant mathematician, there are many situations where you can't really be expected to hit on the solution if you haven't learnt the technique before.
So if that happens - just accept that you haven't learnt how to solve this one yet. And try to find out how to do it. Or if in exam conditions, move on and do the questions you know how to solve, and return to this one if you have time at the end. It's not that likely that you will discover how to solve a cubic equation, say, in exam conditions if you don't know this already. I suppose if you've answered everything else, you could give it a go, might get marks for trying I suppose :).
Here by the way is the way to solve a cubic equation, in case you wondered.