If you encourage someone, you give them confidence, for example by letting them know that what they are doing is good and telling them that they should continue to do it.
If you encourage someone to do something, you try to persuade them to do it, for example by telling them that it would be a pleasant thing to do, or by trying to make it easier for them to do it. You can also encourage an activity.