ARTHUR: You know, it’s at times like this, when I’m trapped in a Vogon airlock with a man from Betelgeuse, and about to die of asphyxiation in deep space that I really wish I’d listened to what my mother told me when I was young.

FORD: Why, what did she tell you?

ARTHUR: I don’t know, I didn’t listen.

Douglas Adams (1952-2001) English author, humorist, screenwriter
Hitchhiker’s Guide to the Galaxy, Phase 1, “Fit the 2nd” (BBC Radio) (1978-03-15)
    (Source)

Adapted into book form in Hitchhiker's Guide to the Galaxy No. 1, The Hitchhiker's Guide to the Galaxy, ch. 7 (1979), with identical dialog. The only difference between the two is that after these lines, in the radio play Ford replies, "Huh! Terrific," while in the book he says, "Oh," and carries on humming.