sich anfreunden mit
to befriend
To begin and build a friendship with someone.
In der neuen Schule hat er sich schnell mit seinen Mitschülern angefreundet.
At his new school, he quickly befriended his classmates.

to befriend / to get used to
Loading your saved state.
to befriend
To begin and build a friendship with someone.
In der neuen Schule hat er sich schnell mit seinen Mitschülern angefreundet.
At his new school, he quickly befriended his classmates.

'Anfreunden' (to befriend / to get used to) is a separable verb. In a main clause, the prefix 'an' goes at the end of the sentence. In subordinate clauses and in the infinitive with 'zu', the verb stays together.
Er freundete sich schnell mit den neuen Kollegen an.
He quickly befriended the new colleagues.
This verb is always reflexive and is used with the fixed preposition 'mit' and the dative. So the structure is always: sich mit jemandem/etwas anfreunden (to befriend someone / to get used to something).
Hast du dich schon mit dem neuen Projektleiter angefreundet?
Have you already befriended the new project manager?
The object after 'mit' reveals the meaning. If a person follows, it means 'to make friends'. If an abstract thing follows, such as 'Gedanke' (thought/idea), 'Idee' (idea), or 'Situation' (situation), it means 'to learn to accept something'.
Sie hat sich im Urlaub mit einer netten Familie angefreundet.
She befriended a nice family while on vacation.
to reject
'ablehnen' and 'sich anfreunden mit' can be opposites when it comes to an idea, a situation, or a suggestion. 'ablehnen' means that you do not accept or approve of something. 'sich mit etwas anfreunden' means that you may find something difficult at first, but slowly come to accept it. So the difference is between a clear no and a growing willingness to accept something.

Nach ein paar Tagen freundet sie sich mit dem neuen Arbeitsplan an.
After a few days, she gets used to the new work schedule.
Viele Mitarbeiter lehnen den neuen Plan ab, weil er zu viel Stress bringt.
Many employees reject the new plan because it creates too much stress.