Layers only work in SOLIDWORKS drawings, not parts or assemblies.
If you use folders to group parts, the contents will become hidden or supressed with the folder.
You can use Advanced selection for the component in an assembly then show/hide as per your requirement.
If you only want to hide or change the appearance of those part you should use display states. If you want to suppress them and their mates you should create a configuration.