What do I do if my baby is distracted and having trouble feeding?

Dim room. Dim the lights and keep the room quiet. Decrease visual distractors (pictures on the wall nearby, comforter over the back of the chair) and stay quiet. Try to maintain eye contact if you can. Maybe hum or sing very softly.
Minimize distraction. Many babies, especially those over 4 months, will become distracted during breastfeeding, especially during the day. They will stop to smile or laugh, turn their head to watch something, or otherwise "goof around"! minimize distractions by nursing in a quiet place. Keep the feeding short and relaxed. If the distractions are too much, stop and try again in an hour or two.