To chat idly or generally waste time talking.
To get distracted and lose track of something (one's train of thought, a conversation).