I have purchased an app but it is not working. If I were to delete it and download it again will I have to pay the second time?
Not if you follow the instructions here:
Downloading past purchases from the App Store, iBookstore, and iTunes Store
I did this and when it was done downloading it gave me the free version and I had paid for the upgraded version.
If it was an in-app purchase see:
iTunes Store: About In-App Purchases
Retrieving data ...