anstecken
to infect
To transmit an illness to another person. Often also used reflexively when you become ill yourself.
Ich habe mich bei meinem Kollegen mit einer Erkältung angesteckt.
I caught a cold from my colleague.

to infect / pin on / set fire to
Loading your saved state.
to infect
To transmit an illness to another person. Often also used reflexively when you become ill yourself.
Ich habe mich bei meinem Kollegen mit einer Erkältung angesteckt.
I caught a cold from my colleague.

'Anstecken' is a separable verb. The prefix 'an-' separates from the verb in the main clause and stands at the end. In subordinate clauses and in the infinitive with 'zu', the verb stays together.
Er steckt seine Kollegen mit seiner guten Laune an.
He infects his colleagues with his good mood.
The exact meaning of 'anstecken' becomes clear from the object. If it is an illness (flu), a feeling (laughter), an object (brooch), or something flammable (house), you know which meaning is intended.
Sie hat sich eine Namenskarte angesteckt.
She pinned on a name tag.
A distinction is made between 'jemanden anstecken' (to infect someone, transitive) and 'sich anstecken' (to get infected, reflexive). The source of infection is named with 'bei' + dative, and the illness with 'mit' + dative.
Steck mich bloß nicht mit deiner Erkältung an!
Just don't infect me with your cold!
This figurative meaning is often used for positive feelings and behaviors. Typical combinations are 'mit guter Laune anstecken' (to infect with a good mood), 'mit Begeisterung anstecken' (to infect with enthusiasm), or 'mit seinem Lachen anstecken' (to infect with one's laughter).
Ihre positive Energie steckt einfach jeden an.
Her positive energy simply infects everyone.
When you attach something to yourself, the reflexive dative construction is often used: 'sich (dative) etwas (accusative) anstecken' (to pin something on oneself). The dative shows to whom the object is attached.
Vor dem Meeting steckte er sich schnell sein Namensschild an.
Before the meeting, he quickly pinned on his name badge.
to transmit / transfer
'übertragen' and 'anstecken' can both describe a disease passing from one person or animal to another living being. 'übertragen' sounds more neutral and is often used in medical or factual texts, including when talking about pathogens or the way a disease spreads. 'anstecken' is very common in everyday language and emphasizes that someone becomes ill through contact; it is also often used reflexively: 'sich anstecken' (to catch something / become infected). The words can be confused because both can fit when talking about illnesses. In practical terms: a disease or virus is 'übertragen'; a person 'steckt jemanden an' or 'steckt sich an'.

Im Bus hat sich Tom wahrscheinlich bei einem kranken Fahrgast angesteckt.
Tom probably caught it from a sick passenger on the bus.
Mücken können bestimmte Krankheiten auf Menschen übertragen.
Mosquitoes can transmit certain diseases to humans.