Open the document with a self-referential to establish who is taking the oath: "I, [name], solemnly swear to ... ." If the oath is to be taken by a group, use "we" instead of "I."
Mention witnesses in the document if there are to be any: "I, [name], solemnly swear in the presence of [names of witnesses] to..."
Write a purpose for your oath, specifically what the oath taker is meant to promise to uphold or to do. The purpose can be as simple as an oath to take out the garbage every Tuesday or as serious as to give time to help others in need.
Close the document by invoking a higher authority or someone you respect relevant to the topic of your oath. Some oaths close with the phrase "So help me God." Others call upon the name of the people or group they represent, such as making an oath to serve your nation. There is also the option of calling upon a single person, such as the leader of your country, company or group.
Make the document legally binding by having it signed by the oath taker in the presence of a notary. The notary serves as a witness to the signing. This step applies only if the oath is meant to be a legal document. Skip this step if you are writing the oath for unofficial purposes such as a club or organization.