The correct answer is: who
The word “who” is used to refer to people. In this sentence, “who” is the subject of the verb “trust.” The sentence is saying that “he” is the friend that the speaker trusts most.
The word “whom” is used to refer to people as objects of verbs or prepositions. In this sentence, “whom” cannot be used because it is not the object of a verb or preposition.
The word “which” is used to refer to things. In this sentence, “which” cannot be used because it is referring to a person, not a thing.
The word “him” is a pronoun that refers to a male person. In this sentence, “him” cannot be used because it is not the subject of the verb “trust.”
I hope this explanation is helpful!