I ruined my short cage 10 speed shimano 105 derailleur, I have the chance to get another and I found a medium cage, will this work by just replacing the derialleurs or will I need to switch other things? Thanks.
Generally you can replace a derailleur with a longer caged one without any problems. The length of the cage determines the "spread" of gears that the drivetrain can support.
So, for example, the short cage might get you a 11-28 cassette where a medium cage might work up to 11-32. Note this is just a "for instance" and the specific sizes depend on several factors.
You will almost certainly need to replace your chain since the medium cage will need more links. But it's hard to replace a derailleur without breaking the chain anyway so plan on that.
First, consider if you actually have destroyed the previous derailleur. In a crash, the derailleur hangar is designed to be the weak link, and it will bend. So, if you can’t shift properly, have you checked the hangar alignment? If you’ve bent the hangar, you will need to replace it. Your bike store or another dealer for the bike in question can source a replacement hangar from the manufacturer. Alternatively, there are third party manufacturers for replacement hangars (most notably Wheels Manufacturing in the US). In my experience, rear derailleurs probably won’t get damaged beyond usability in a crash.
If you actually need a new RD and not just a hangar, most likely you can just swap the derailleurs without changing anything else. The maximum cog size for the short cage RD is 28t. In contrast, the medium cage RD is rated for 28t and up. In my experience, a medium cage RD will actually shift a 12-25 cassette, although the shifting isn’t ideal. Few if any bikes come with 12-25s, so most likely your cassette is within spec anyway. Typical method of chain sizing is independent of RD cage length, so I don’t think chain length matters that much.