The Shulchan Aruch states that one should not carry anything in the public domain, “samuch le’chashechah,” close to the time when it becomes dark because we are worried that he may forget about the item he is carrying and may go into Shabat carrying.
The Be’ur Halachah and the Halachah Berurah quote from a Yerushalmi that this time of “samuch le’chashechah” is two and a half hours before sunset. The Rabbis however, state that today, there is room to be lenient being that the public domain today is only a rabbinical enactment.
In a town where there is an Eruv, even though it may be questionable if one can use this Eruv on Shabat, regarding this halachah it can be relied on.
The Shulchan Aruch also states that one is obligated to check his pockets for anything that would be forbidden to carry on Shabat before Shabbat, lest he transgress the sin of carrying in the public domain on Shabat.
The Mishnah Berurah states that even if there is an Eruv in the town, a person still must check his pockets, because there might be a muktzeh item in his clothing which is forbidden to touch on Shabat. The Mishnah Berurah adds that this rule applies on Shabat morning as well. When one puts on his clothing, he should check his pockets for something he may have left there by mistake.