This behavior may or may not be easy to remedy, mostly dependent upon how you handle the situation, what your dog's general temperament is like, and what the relationship between you and your dog is like.
While this can be a confusing, possibly even hurtful stage for you, it is important for you to understand what is most likely happening.
Your dog is probably entering his/her "teenage" years, so to speak.
This is probably a time in your dog's life when they have come to a point in their relationship with you where they are growing a little tired of you.
Not that they don't like you anymore, more like a rebellious stage.
They may have the mindset that says they don't really need you, thus, they are not going to do what you say.
Probably the best thing you can do about this is to continue loving your dog.
Maybe go over basic obedience exercises again, reinforcing both the fact that you are in charge and that you love your dog.
And don't worry, most of the time this stage passes within a few months, and things will continue as normal.
Consider it a time in your dog's life where he is going through a change, and if he/she has ever needed a friend, it is now.