I asked the Prophet ﷺ about one's looking here and there during the prayer. He replied, "It is what Satan steals from the prayer of any one of you."
عَائِشَةُ ؓ سَأَلْتُ النَّبِيَّ ﷺ عَنِ الْتِفَاتِ الرَّجُلِ فِي الصَّلاَةِ فَقَالَ هُوَ اخْتِلاَسٌ يَخْتَلِسُ الشَّيْطَانُ مِنْ صَلاَةِ أَحَدِكُمْ