YW is a polite but casual reply. It's polite and informal, and it's appropriate for friends, family, classmates, coworkers in casual conversation and online communities. In formal letters or when you are talking on a professional level, it may be better to say "you're welcome" or "my pleasure".
Also Read - https://slangspot.com/yw-meaning/ (https://slangspot.com/yw-meaning/)