On this page of the LEGO Star Wars Skywalker Saga guide, you can find information on how to destroy effectively silver and gold objects that may seem indestructible. The methods described above assume selecting characters from appropriate classes having the skills or equipment to destroy silver and gold objects.
Destroying silver objects
Silver objects are primarily various types of containers that may differ in size. Each of them shines slightly, and you can spot them more easily among other objects in the environment.
Silver objects are indestructible by default. The solution to this problem is to switch to any character from the Villains class. It can be, for example, the B1 Battle Droid shown in the picture above. You can unlock new villains as you progress in the game or purchase them for studs.
After switching to the villain, you have to face the silver object. You will get a message about the possibility of throwing a grenade (example in the picture). Press the throw button. A grenade explosion will destroy the silver objects, and if it has any content (e.g. collectible), you will gain access to it (the content is not destroyed by the explosion).
Destroying golden objects
Gold objects cannot be destroyed with regular (melee or ranged) attacks. In their case, they are usually various types of blocades that may, for example, prevent you from using an alternative path or reaching a secret chamber.
To solve the problem and be able to destroy gold objects, switch to any character from the Bounty Hunter class. It can be, for example, the famous Boba Fett from the picture above. You can unlock new bounty hanters as you progress in the game or purchase them for studs.
After switching to the bounty hunter character, aim at the gold object - the shooting button's icon should display on the screen (example in the picture). Start shooting. The bounty hunter's blaster will be enough to smash golden objects.
Additional note: You can also come across silver and gold objects in story missions. Likely, you won't be able to destroy them then, as there will be no villains or bounty hunters on the active party. You have to repeat this stage (after completing it for the first time) but in Free Play mode. It allows you to select all unlocked characters and unlimited switching between them.