The line occurs in Harry Potter and the Sorcerer's Stone, Chapter 5: "Diagon Alley."
After Hagrid tells Harry about the Sorcerer's Stone and Voldemort's desire to steal it, he becomes flustered and says:
"But, er — " Hagrid looked flustered. "There's — there's a few things yeh need ter know, an' I should not have said that."
This moment foreshadows the central mystery of the novel and highlights Hagrid's endearing inability to keep secrets—a trait that repeatedly drives the plot forward.