In John 18:31-37, during his trial before Pilate, Jesus asserts that his kingdom is not of this world and speaks about his purpose of testifying to the truth. Pilate questions Jesus about his kingship and the accusations from the Jewish leaders. The passage highlights the distinction between earthly authority and spiritual truth.