This entire phrase means to be a friend and a helper of the righteous and pious people who maintain religion and believe in God. Specifically, it is directed to the prophets and imams (successors to the prophets), as well as those who work to establish order, justice, and religion on earth, as the Quran notes,
“And whoever takes Allah, His messenger, and those who have belief as protectors and guardians, then the party of Allah will be victorious.”(5:56)