The first step is acceptance of the behavior. You may be filled with anger, doubt, and hatred towards yourself and the other person for the way you were treated. Accept that you can not change everything and you functioned based on whatever understanding you had about relationships. Learn your lesson and end the relationship kindly and move forward with better clarity of what you actually want from a real relationship.