I've gotten constructive criticism in writing groups for my writing (although some people in writing groups gave me criticism intended to be constructive but not actually useful because they misunderstood what I was going for, especially when I was writing different genres than the rest of my group). I've also gotten constructive criticism for social situations from counselors and from my parents.
One of the most important things for me about constructive criticism is consent. If I didn't want or need advice, it's pretty much impossible to give me criticism without hurting my feelings or getting me annoyed. It's a good idea to just outright ask "would you like some advice?" and only give the constructive criticism if they say yes. (Although my dad also asks that question before giving joke advice that's super obvious, like "don't do that again" about dropping a heavy thing on your foot.)
It's also important for people to recognize that I can tell if a piece of advice is actually likely to be helpful to me or not, and not get offended if I conclude that their advice isn't going to help. I will often explain that their advice isn't helpful and why, this is intended as a constructive criticism of my own to guide them in offering better advice, as well as to communicate why I'm not doing what they suggested. Usually, unhelpful advice comes from someone who is lacking crucial information that I didn't realize was crucial or lacking when I explained the problem. The problem is when they're unwilling to learn from my clarification, and especially when they're personally invested in me following their advice.
Constructive criticism also must be specific and involve a clear course of action that can be taken to make the situation better. So for example, in writing, "I didn't really like the main character" isn't constructive. "I didn't like the main character because he complained constantly about problems that he'd caused and was nasty to people who were being kind to him" followed by examples of the main character doing those things is a lot more constructive. It explains exactly what the perceived problem is, and points to specific scenes that you could change to fix that problem. (Of course, if the main character is intended to be unlikeable, or you conclude that this reader isn't part of your intended audience, this advice might still not be applicable.)