legen
to lay / put
To bring something into a lying, horizontal position or put it in a specific place.
Sie legte das schlafende Baby vorsichtig in sein Bett.
She carefully laid the sleeping baby in its bed.

to lay
Loading your saved state.
to lay / put
To bring something into a lying, horizontal position or put it in a specific place.
Sie legte das schlafende Baby vorsichtig in sein Bett.
She carefully laid the sleeping baby in its bed.

'Legen' (to lay/put) describes movement to a place and therefore almost always needs a complement in the accusative. You ask: Whom or what am I laying/putting? Where am I putting it?
Ich lege den Stift auf den Tisch.
I'm putting the pen on the table.
The reflexive form 'sich legen' (to lie down) means that a person or animal moves themselves into a lying position. Here too, a 'where to?' phrase in the accusative often follows.
Nach dem langen Tag möchte ich mich nur noch aufs Sofa legen.
After the long day, I just want to lie down on the sofa.
When the subject is something abstract or a natural phenomenon, e.g. 'der Sturm' (the storm), 'die Aufregung' (the excitement), or 'der Schmerz' (the pain), 'sich legen' means that it loses strength or stops.
Der Wind hat sich über Nacht gelegt.
The wind subsided overnight.
The expression 'Wert legen auf etwas' (to place value on something) is fixed and is always used with the preposition 'auf' and the accusative. It means that you consider something important.
Er legt viel Wert auf eine gesunde Ernährung.
He places a lot of value on a healthy diet.
In biology, 'Eier legen' (to lay eggs) is a fixed collocation that describes how certain animals, such as birds, insects, and reptiles, produce their eggs.
Die Schildkröte hat ihre Eier am Strand gelegt.
The turtle laid its eggs on the beach.
The idiom 'den Grundstein legen für etwas' (to lay the foundation for something) is a fixed expression. It is used with the preposition 'für' and the accusative and means to create the basis for something in the future.
Mit diesem Vertrag legen wir den Grundstein für eine erfolgreiche Zusammenarbeit.
With this contract, we are laying the foundation for a successful collaboration.
to do
'tun' and 'legen' can both mean that you put something in a place. 'tun' is very general and often colloquial: you can put something into a bag or onto a table. 'legen' is more precise because it usually means that something lies down or is brought into a lying position. Learners may confuse the words because both can be connected with a place. When the position is important, 'legen' sounds more natural. When you are only saying generally where something goes, 'tun' can fit, especially in spoken language.

Lisa legt ihr Handy auf den Tisch, bevor sie kocht.
Lisa puts her phone on the table before she cooks.
Kannst du die Milch bitte in den Kühlschrank tun?
Could you please put the milk in the fridge?