honestly margit was one of the hardest bosses for me in that game. it was my first souls game and figuring it out is hard af. if you cant beat him the just leave and go explore. there are tons of ways to change the difficulty too. maybe go grab some summons or look up where a good weapon is. you may not be able to pass margit yet but you WILL be able to.