Every sin that a believer commits because he makes a mistake, or forgets, or is forced to do it, is forgiven by Allah.
وَلَيْسَ عَلَيْكُمْ جُنَاحٌ فِيمَا أَخْطَأْتُمْ بِه ِِ وَلَكِنْ مَا تَعَمَّدَتْ قُلُوبُكُمْ ۚ وَكَانَ اللَّهُ غَفُورا ً رَحِيما ً
*“And there is no sin on you concerning that in which you made a mistake, except in regard to what your hearts deliberately intend”*
[Qur'an, 33:5]
We will be held responsible for sins committed deliberately. But if we repent and seek forgiveness of Allah sincerely. Then Allah will forgive our sins and shortcomings.
Don't lose hope .
Allah is Merciful.