I've eaten out of date beans, I'm still here! but yes I would discard bulging or rusting tins and others have said taste and smell are the ultimate indicators. Also have used out of date, flour and baking powder, I think like many, we over bought during the pandemic when initially there was a shortage of some items and then they became available again. I really hate wasting food it seems just wrong, so I'm pretty careful with perishables making sure they are eaten but sell by dates and long shelf stuff, well I tend to think those dates, whist a guide don't have to be adhered to that strictly.
Think I read somewhere that an ancient tin of something or other was opened after maybe a hundred years and still deemed edible, but that would take a brave person, I wouldn't want to be part of such an experiment!