The Messenger of Allah ﷺ said: Going round the House (the Ka'bah), running between as-Safa and lapidation of the pillars are meant for the remembrance of Allah.
قَالَ رَسُولُ اللَّهِ ﷺ إِنَّمَا جُعِلَ الطَّوَافُ بِالْبَيْتِ وَبَيْنَ الصَّفَا وَالْمَرْوَةِ وَرَمْىُ الْجِمَارِ لإِقَامَةِ ذِكْرِ اللَّهِ