How to output a gpio pin via a button im HOME ASSISTANT

Hello guys! I am new to the Home Assistant thing, K tried to output a gpio semnal to a relay via a button, but I failed. Can someone help me, do I need a third-party library?

GPIO pin/relay/button on what?
What are you trying to make HA do?