ことのないように means "so that X does not happen", "so as not to". It follows a verb in the dictionary form, and the clause after it says what to do to prevent X. It is a formal ないように, and you read it in instructions, notices, and company or official announcements.
The verb goes in the dictionary form, not the ない-form: ×忘れないことのないように. The negative is already in ない.
Both mean the same. ないように is what you say; ことのないように is heavier and more formal, and the thing to be avoided is usually serious – an accident, a leak, a repeat of a mistake.
The second clause is usually a request (ください, おねがいしますお願いします) or a statement of what is being done about it.
These go beyond the full form.
Inside the clause, the subject can take の instead of が: じこ事故のおきる起きることのないように. Both are correct; が is more common.