At the end of The Outsiders, Ponyboy Curtis has been through so many traumatic events in the past couple of days that he does not know how to cope with his grief. Ponyboy denies Johnny's death as a survival mechanism, because he has so much grief, pain, and disappointment to deal with. Denying Johnny's death helps him to compartmentalize his emotions, allowing him to deal with the tragedy at his own pace and time. Interestingly enough, the first stage of grief, according to the Kubler-Ross Grief Cycle, a psychology theory, is denial.
Denial and shock help us to cope and make survival possible. Denial helps us to pace our feelings of grief. There is a grace in denial. It is nature’s way of letting in only as much as we can handle ("Stages of Grief")
Ponyboy's reaction to Johnny's death reveals much about how worn down he actually was at that point. Darry tells Pony that he was in no condition for the rumble that night; he had "exhaustion, shock, minor concussion" (156). Remembering the rumble brought back more painful memories for Ponyboy though, and he warns himself:
"Don't remember how Johnny was your buddy, don't remember that he didn't want to die. Don't think of Dally breaking up in the hospital, crumpling under the street light."
When Randy comes to visit, Ponyboy falls apart, refusing to believe that Johnny is dead. His complete and utter denial at this point suggests that Ponyboy has begun the first stage of the grieving process.
He was trying not to remind himself.