As long as the embers are not too close to the edge of the fireplace, it is generally safe to go to bed with them still burning. However, it is always best to extinguish them before going to sleep for peace of mind. If you have a gas fireplace, you should always turn off the gas before going to bed.