Run JL_Cmdr . It has an option to reset the phone to factory. Be sure you are on the carrier released operating system before returning as well. Or you can do it on the device at Options > Security Options > General Settings > (press Menu key) > Wipe Handheld. Make sure you check all boxes like removing 3rd party apps and erasing storage card.
Do you mean wiping as in simply clearing all personal data before selling it? If so, go to Options...Security Options...General Settings...Press BB Button...Choose Wipe Handheld.
If you mean wipe as in getting it ready for an OS upgrade, see my signature. Enter "wipe" in the search field and you'll get quite a few threads on various programs that can wipe.