It is clear that you both need to sit with a local marriage counsellor who
can advise you how to strengthen your marriage. Even of your husband is
not inclined to go, you should talk to someone yourself and seek their
As for your affairs, I am uncertain what online affair entails exactly, I
presume it was not physical relationships? As you know, any such acts are
completely condemned in Islam and should be avoided at all costs.
Moreover, they will not achieve the happiness you seek because they tend
to be artificial and dishonest.
Keep talking to your husband also and communicate your needs to him so
that he understands clearly
your unhappiness with things as they stand.
With prayers for improvement