Prep them for what the dog needs, and if you think the dog may need to be euthanized at some point, have a discussion about "the vet helps dogs in pain to die without pain and fear." Decide now about using terms like "put to sleep" or "put down" - the 4 year old especially might be afraid to go to sleep if confused.
Start thinking now about collecting memories - photos, comments from the kids on video, etc. You can create a scrapbook later on - hard copy or electronic.
Decide also on what you will do about burial, cremation, etc. We buried our dog in the yard at the edge of the woods, and we included her blanket and a chewy toy. We worked as a family to make a marker from one of those "garden stepping stone" kits at the craft store. Other people scatter ashes in the woods or at the nature preserve, etc. Make sure it fits in with your religious beliefs, and talk about timetables for grief (and how there aren't any). Friends gave us a hyacinth plant, which we replanted near her grave - every year those flowers come up and it's kind of nice.
There's a written piece called "The Rainbow Bridge" that many people find comforting. We got a card from our vet's office (everyone signed it) that also contained this piece.
Good luck - I know this is hard.