The words obedecer and atenerse seem to have very similar meanings, both meaning obey or go by. What's the main difference between them? Are they interchangeable or are they used in certain phrases?
I can say that they might have similar or totally different meanings.
When we talk about "Obedecer" we talk about strictly DO whatever something or someone says
"obey the rules"
"obedecer las reglas'
"obey your mother"
"obedece a tu madre"
but when we talk about "atenerse" its about "stick" , is rather the idea of being forced into something than having you obeying. "atenerse" is also more inclined towards something that you have to be prepared for, it also has a negative connotation.
So when we use "atente" we are trying refer to the negative impacts of not following, obeying or not being prepared for something.
For this I will provide some translations about the whole idea of "atente" and not just the translation of the word
"atente a las consecuencias"
"prepare for the consequences/face the consequences/be ready for the consequences"
"atente al cambio"
"Prepare for the change/Be ready for the change/Beware the change"
"atente a las reglas"
follow the rules and be aware of the consequences of not following them
------------------------ edit, another example --------------------------
another example that i think is helpful to understand this is using it on the past tense
"El se atuvo a las consecuencias"
that meas something like
he withstood/faced the consequences
Please keep in mind for next time, it's best practice to include definitions of the two words you're comparing, with links to the dictionaries you used. Also, it's good to expand your question, to show us where you're getting hung up, using some standard resource.
My instinct about this was that "obedecer" would be more for children and soldiers, and "atenerse" would be more for people who can be trusted to think and use their best judgment. The examples provided under "obedecer" in spanishdict.com support this guess:
Es un niño bien educado; siempre obedece a su madre. | He's a well-behaved child; he always obeys his mother.
El viento obedece a una tormenta que se acerca. | The wind is due to a storm that is approaching.
Tienes que aprender a obedecer sin replicar. | You have to learn to obey without talking back.
Note that the wind definitely doesn't think or use its best judgment!