For this you need to enable checkpointing and make sure that checkpoints are successful.
If the checkpoints are stored successfully in a persistent storage, all the operators in the job will restart from their last checkpointed state.
This doesnt mean that data won't be duplicated though and it will depend on your Source and Sink. For e.g, Kafka Source with READ_COMMITTED and Kafka Sink with Transactions enabled wont duplicate data. But same guarantee doesnt hold true for other source and sinks.