How can one deal with students who don't do their homework?
As you have not specified a grade level here, I will address the issue of university level students who do not complete homework.
Your main tool for addressing this problem is your syllabus, which should deal preemptively with the issues of late or incomplete assignments. Given the increasingly litigious nature of the university environment, and the increasing frequency of grade complaints or challenges, you must be extremely careful to set out policies clearly and to apply them uniformly to all students. If a student has a documented disability, you must follow accommodation plans which may include extended deadlines or creating alternative assignments. You should not accommodate disabilities without official documentation simply on the basis of students' claims.
Next, you should familiarize yourself with your departmental and university policies and procedures for reporting students who miss classes or are in danger of failing. In many cases, there are special reporting procedures for students receiving government loans or grants or student athletes who miss a certain number of days of class or assignments or who are in danger of failing.
Next, you should have detailed instructions in your syllabus concerning how assignments are to be submitted and what constitutes a late assignment. For example, you might specify that all assignments must be submitted on a course-management system by midnight on a specific date and that an assignment will be considered late or missing if not submitted in precisely that way. This deals with the problem of students who claim to have handed in assignments but have actually not done so. You should have fixed numeric penalties for late assignments and missed assignments and specify what constitutes a legitimate excuse for late assignments.
I tend to simply assign a grade of F (or 0/100) for missed assignments and a sliding scale of penalties for late assignments. In addition to these steps, after I grade a set of assignments, I go through my online gradebook and send a mass email to all students who have not submitted a given assignment stating:
If you are receiving this email, according to my records you have not submitted Assignment X, which was due on DD/MM/YYYY, and currently have a grade of F for that assignment. If you plan to turn in the assignment at a future date or have a legitimate excuse for not having completed it, please contact me.
However, if a student regularly attends class and fails to complete assignments, it is worth talking with the student to see what might be the issue. In my experience, the students who do not complete the assigned work rarely show up to class.