If I think I committed kufr by accident is it obligatory for me to recite the shahadah? Or should I just repent to make sure I’m forgiven

It’s not obligatory to recite the Shahada. Just ask Allah for forgiveness