How should I delete the data from an iPhone 5?

I am going to sale my iPhone 5, so I want to delete the entire data stored in it. And at the same time I am bit worried, that by simply deleting the data from it, Will my deleted data will remain safe? Kindly suggest me, what should be the appropriate way of deleting the data from my iPhone 5 permanently. Thanks!