There are so many Code examples available with PSoC Creator. You can refer to the code examples and create your own project. You can also refer to AN91162 - Creating a BLE Custom Profile .
Thank you for that answer, but it's not the help I'm waiting for.
I am already studying Cypress documents !
And if I was already able to create my application, I would not have asked for help.
Set one of the devices as central, one as peripheral
Set up the peripheral to advertise when it turns on
Set up the central to scan when it turns on
If the central finds the peripheral, have it connect to it
Depending on your application you can have the button/relay be on whichever you choose, but it changes the code flow either way.
Assuming you put the button on the central, and the relay on the peripheral:
Have the central send a write to the periphal for a custom characteristic that holds the "state value" for the relay based on what the button's state is.
On first connecting to the peripheral have the central write the button state to ensure the relay is set as desired
Whenever the peripheral receives the write event, check the relay state and have it match the button state.
Use a confirmed/reliable write if you need guaranteed operation
Without writing the program for you, you need to ask specific questions about where you are stuck rather than panicking and asking for someone to give you the whole project.
This example: Project #003: BLE Custom Profile - CapSense and RGB LED
Has the peripheral already setup more or less how you want it, meaning you can just modify it to work for your case, and then just implement the central device to work with it.