Is it safe to use a string of lights with one shattered
It is not safe if the string is of incandescent bulbs, because there will be exposed line voltage in the broken bulb.

In that case, remove the broken bulb and plug it in. If the string lights (it.has parallel wiring; usual for large screw-in bulbs), then you're fine. If it does not light, you will need to replace the bulb (it has series wiring, usual for small push-in bulbs).

If the string works without the bulb and you don't intend to replace it, wrap electrical tape (or whatever plastic or cloth you have available) over the socket so nobody can accidentally put a finger into it.

LED strings may or may not have safe low voltage, depending on how they were designed.