sich etwas anschaffen
to acquire
To buy or acquire something, usually a larger or durable item for one's own use.
Wir wollen uns nächstes Jahr ein neues Auto anschaffen.
We want to acquire a new car next year.

to acquire / work as a prostitute
Loading your saved state.
to acquire
To buy or acquire something, usually a larger or durable item for one's own use.
Wir wollen uns nächstes Jahr ein neues Auto anschaffen.
We want to acquire a new car next year.

'Anschaffen' is a separable verb. In a main clause, the prefix 'an-' goes at the end. In the infinitive with 'zu', 'zu' goes between the prefix and the verb.
Wir schaffen uns einen neuen Fernseher an.
We are getting ourselves a new TV.
In the meaning 'kaufen' (to buy), the verb is almost always used reflexively: 'sich (dative) etwas (accusative) anschaffen' (to get/acquire something for oneself). The 'sich' emphasizes that you are acquiring something for your own use.
Ich habe mir letztes Jahr ein E-Bike angeschafft.
I got myself an e-bike last year.
You typically 'schafft sich' larger, durable things, not everyday consumable goods. Common examples are furniture, a car, a pet, or technical devices.
Bevor wir uns einen Hund anschaffen, müssen wir die Wohnung vorbereiten.
Before we get ourselves a dog, we need to prepare the apartment.
Be careful: the fixed expression 'anschaffen gehen' is a colloquial euphemism for prostitution. It has nothing to do with shopping and should not be confused with it.
Der Dokumentarfilm zeigt das harte Leben von Frauen, die anschaffen gehen.
The documentary shows the hard life of women who work as prostitutes.
The meaning 'befehlen' (to command) or 'anordnen' (to order) is very rare today and is considered outdated. You almost only find it now in historical novels or old, formal texts.
Der General schaffte an, dass die Truppen vorrücken sollten.
The general ordered that the troops should advance.
to buy
'kaufen' and 'sich etwas anschaffen' both mean that you get something in exchange for money. 'kaufen' is general and works for small and large things. 'sich etwas anschaffen' is used more for things you use for a longer time or that involve a deliberate decision, for example a car, a pet, or a new device. It often sounds as if you had thought about it beforehand. For a coffee or a bread roll, you would not normally say 'anschaffen'.

Herr Schwarz schafft sich im Sommer ein neues Fahrrad an.
Mr. Schwarz is getting himself a new bicycle in the summer.
Vor dem Wochenende kaufe ich der Ärztin noch eine Dankeskarte.
Before the weekend, I'll buy the doctor a thank-you card.