You’re just starting out, but what you’re asking for is a bit advanced.
This explains how to use context.id in an automation to determine whether a switch was physically pressed or not.
I can’t help much beyond providing that link though - still have to delve into using context.id in my automations.