How to handle coupled components in Unity

The idea on ECS architecture is that you have components that are pure data, that are being added to the Entities that are pure collection of Components and then you have systems that depending on the containing component types of each entity either process the entity or not eventually completing some functionality. The benefit is that when you add or remove a component (which is just data), you change the behavior of the Entity.

In Unity things are in different way. You have predefined components for which some functionality is written in the engine. You can also define Scripts which contain data AND behavior. What if that behavior requires data farm multiple Components/Scripts? [In pure ECS it is always like that - several components constitute a single functionality. (e.g. PositionComponent and MoveComponent together result the Entity to move and if one of them is absent, Entity will not move).] I mean I can randomly add and remove components and Scripts, and still each Script in my Game Object should know if it has all the components required to accomplish the functionality. How should I achieve this in Unity?

P.S. I need this so that if I would remove a component/script some functionality will be disable util I add it back.

I found your question a little unclear but I think you are looking for this

Which will automatically add a required component if flagged in a script.

I dont believe there is one for removing. Its easy enough to Destroy(Component) in your script though.

You probably know that scripts are often linked with GetComponent.

Unity doesnt identify with one Pattern, although it is Object and Component Based. You are pretty much free to mix your patterns as you require them. I’d say Unity is a little different from the Computer Science “Stick to the book” way of doing things.

Why not just execute code on awake and ondestroy?