to persuade someone not to do something, especially by making it seem difficult or bad [≠ encourage]:
attempts to discourage illegal immigration
discourage somebody from doing something! Do not say 'discourage someone to do something'. Say discourage someone from doing something.
My father is a lawyer, and he discouraged me from entering the field.
to make someone less confident or less willing to do something [= demoralize; ≠ encourage]:
You should not let one failure discourage you.
to make something less likely to happen [≠ encourage]:
Aspirin may discourage tumour growth in some types of cancer.