Ive made a mistake and I don’t know how to correct it

When I was getting over my first boyfriend I made the mistake and started catching feelings for my cousin which was wrong because he was engaged and about to get married within a year. I think the family has picked up on this and has since started making little jabs at me at events. Honestly I didn’t even know what I was doing or acting in the moment but once you make a mistake in this family they run with it forever. How do I overcome this as he is family not just a random guy? Should I stay away from family events? Should I apologize for my actions? I do not want the awkwardness to last.