You avoid this by having the form processing page (the "action" page) redirect to a display page once it is finished processing the submitted data. That way if the page is refreshed, it's the display page and not the processing page that gets refreshed. Unfortunately, if they hit back twice they will still get to submit the data again. This cannot be prevented, however, you can check server-side if they are submitting the same data a second time and prevent it.
Sometimes it is useful to be able to resubmit the form, especially when you have just been presented with a page containing an error message like: Network Timeout! The page you requested failed to return a response in a suitable time. or Transfer interrupted! The page you requested failed to respond.