Middle English banefyre is attested for fires burning bones, with fifteenth-century citations including the burning of heretics' and animals' bones, and the contraction to bonfire follows. The bon equals good explanation appears in later centuries and is listed by the OED as a folk etymology.
The seasonal version ties bone fires to midsummer and St. John's Eve, when communities burned bones and refuse on hilltop fires, part cleansing, part beacon. Antiquarians of the eighteenth and nineteenth centuries preserved these accounts, sometimes dressing them as pagan survival.
The grim note made by word historians: English kept burning things in the open for festival light for a thousand years and only the name changed, so the word's softness tracks our distance from what the fires were for.
The cheeriest fire word in English is a disposal method wearing a French costume. How many warm words are standing on ash?