The place where I live it has a very bad condition no matter how much I try to avoid sometimes unintentionally my eyes might fall on some non mahram will it be considered a sin if it’s unintentional

Unintentional looking is not a sin, as long as you have not purposefully put yourself in a situation where it would surely happen (eg beach)