What to wear to cousins wedding?

I’m going to my second cousins wedding, we aren’t super close. I thought I was supposed to wear a suit but my dad said it was unnecessary, we were never given a dress code. I was thinking maybe some slacks, a shirt and maybe get a suit jacket from a charity shop? What would you say is the proper clothing choice?