Relays like this often have a built in optocoupler that allows them to trigger from quite low voltages. What @SJ20035 says is probably the issue but it’s hard to tell without the relay specs and your yaml.
There is usually details on using the component from anywhere you buy it. Look for the Specifications or Documentation section for details and instructions. This is how you learn how to use things and it needs to be the first place you look, even before you buy something.