The rules allow fair racing and should prevent collisions. The majority of situations are covered by just a few rules. It is not necessary to understand them all when you start racing. A better understanding will come with experience. Be aware of your rights and obligations to others.
Having broken a rule you can exonerate yourself by doing a penalty turn at the first opportunity. A penalty turn will normally be one turn or two turns as defined by the rules. A one-turn penalty is a tack and a gybe in the same continuous direction. A two-turn penalty is two tacks and two gybes taken continuously in the same direction. Find out what penalties are in place before you race.