Thanks for writing to us
It's not uncommon in young people like yourself to have these neck pains. These as you might have figured out are posture related. Though self limiting, it need not be underestimated.
All you need to do is correct your posture habits, like appropriate neck position while working on computer, avoiding pillow while sleeping, or while making sudden movements. I assure you this discomfort will go away unless you do something to aggravate it in your routine. That may also include the yoga
you do, and you should consider suspending it until the pain goes away completely. You can gradually resume them and even do neck isometric exercises, which you can learn from a physiotherapist near you
I do hope that you have found something helpful and I will be glad to answer any further query.