The iPhone 4 is pretty old hardware at this point, so if you've tried multiple SIMs and nothing's worked, it's probably not just dirt. What maybe hasn't been mentioned is trying something more aggressive: grab a toothpick or something with a really fine point and gently press the gold contacts inside the slot while you're inserting the tray. Sometimes the internal springs get stuck or misaligned after years of use, and a little push in the right spot gets them working again. That's actually worked for me with old phones.
That said, if that doesn't do it either, honestly at this point repair isn't really worth it. A new tray is cheap, but if it's the connector on the motherboard that's damaged, the fix costs almost as much as a decent used phone. The iPhone 4 is almost fifteen years old now, so spare parts are getting rarer and rarer, and techs charge quite a bit to hunt them down. You're better off saving those euros and starting to think about something more modern that'll at least last you another few years without surprises.