Two points: is your goal to be perfect (i.e., make no mistakes), or is your goal to improve the product? In the later case, constructive criticism is only moving you closer to that end goal, and can be welcomed happily.
Second point, do you respect the person giving your work criticism, and do you accept that it is useful for the product? If yes, then great, why feel bad if the goal was to improve the product, and their criticism will only make your work better. If no, then this can be a difficult situation, and I personally have been here before. I try to see things from their perspective, ask questions, etc., but there are definitely times when you will fundamentally disagree with the utility of the criticism, and this can indeed be a hard spot.
This all said, the manner of delivery makes a big difference. "Do better" is not useful feedback because it is not actionable. If you are getting this kind of feedback, consider finding a new job / manager. Feedback that is well thought out and actionable (e.g. "this can be refactored like so", or "this function needs another test case") is more than likely coming from a perspective that has seen many things go wrong, has an intuition about what can go wrong, and can be a learning experience for you. Sometimes, the problem cannot be articulated so clearly, in which case your manager should be careful to say so and they will have to put in some thought themselves into the problem and how to find a solution. If they are not then they are only doing half of their job.
Then it sounds like you don't enjoy your job, in which case it is normal to feel bad when receiving negative feedback, and it also sounds like there are bigger issues.
Second point, do you respect the person giving your work criticism, and do you accept that it is useful for the product? If yes, then great, why feel bad if the goal was to improve the product, and their criticism will only make your work better. If no, then this can be a difficult situation, and I personally have been here before. I try to see things from their perspective, ask questions, etc., but there are definitely times when you will fundamentally disagree with the utility of the criticism, and this can indeed be a hard spot.
This all said, the manner of delivery makes a big difference. "Do better" is not useful feedback because it is not actionable. If you are getting this kind of feedback, consider finding a new job / manager. Feedback that is well thought out and actionable (e.g. "this can be refactored like so", or "this function needs another test case") is more than likely coming from a perspective that has seen many things go wrong, has an intuition about what can go wrong, and can be a learning experience for you. Sometimes, the problem cannot be articulated so clearly, in which case your manager should be careful to say so and they will have to put in some thought themselves into the problem and how to find a solution. If they are not then they are only doing half of their job.