anlehnen
to lean
To place or position something or oneself at an angle against a vertical surface for support.
Du kannst dein Fahrrad an die Hauswand anlehnen.
You can lean your bicycle against the wall of the house.

to lean / be based on
Loading your saved state.
to lean
To place or position something or oneself at an angle against a vertical surface for support.
Du kannst dein Fahrrad an die Hauswand anlehnen.
You can lean your bicycle against the wall of the house.

'Anlehnen' (to lean) is a separable verb. The prefix 'an-' stands at the end in a main clause. In subordinate clauses or in the infinitive with 'zu', the verb stays together.
Er lehnte sein Fahrrad an den Zaun an.
He leaned his bicycle against the fence.
The meaning can be recognized from the object. If it is about concrete, physical things (person, bicycle), the literal meaning is intended. With abstract things (film, theory, novel), the figurative meaning 'to be based on' is intended.
Bitte lehne die nasse Jacke nicht an die Tür an.
Please don't lean the wet jacket against the door.
In the literal meaning, the target that something is leaned against is always indicated with the preposition 'an' and the accusative. The verb can also be used reflexively ('sich anlehnen' — to lean oneself/lean back).
Er lehnte sich erschöpft an die Wand.
He leaned exhausted against the wall.
In the figurative meaning, the verb is always used reflexively and with the fixed preposition 'an' (+ accusative): 'sich an etwas anlehnen' (to be based on something). It means that something serves as a model or basis.
Das Design des neuen Autos lehnt sich stark an klassische Sportwagen an.
The design of the new car is strongly based on classic sports cars.
to invest / create / dock
'anlegen' and 'anlehnen' look similar, and both can have to do with a movement toward something. Even so, 'anlegen' here means bringing something onto the body or onto a surface, for example a bandage, jewelry, or a jacket. 'anlehnen' means that something is standing at an angle against a surface, or that someone is leaning against something for support. The risk of confusion mainly comes from the similar form. Remember: you put on a bandage with 'anlegen'; you lean a ladder against the wall with 'anlehnen'.

Im Flur lehnt Mehmet sein Fahrrad an die Wand.
In the hallway, Mehmet leans his bicycle against the wall.
Die Ärztin legt dem Kind vorsichtig einen Verband an.
The doctor carefully puts a bandage on the child.