George,
Easier said than done, many times. Students get disengaged for many reasons, such as illness, bored, unprepared, don't understand, distracted, preoccupied, overwhelmed, worried (finances, work, family/spouse, childcare), or busy, to name just a few. One key is to try to identify why there is disengagement, diffuse that, and bring them back to task. Asking questions of specific students, involve them in discussion, have them write on the white board -- movement and physical activity is always a good way to get students paying attention.
Barry Westling