Depending on the complexity of your form, different approaches may be needed, but the simple way to clear a form is to use the reset statement.
In JavaScript, use:
xfa.host.resetData("object name");
will clear any data in that object. The object can be an entire form, page, or individual object on the form.
You can use that a button (click event) or on other events, depending on what you want to do with your form.