You use automated crypto trading bots by connecting them to exchanges using an Application Programming Interface (API). In crypto trading, an API is an interface that acts as a bridge between crypto trading bots and the exchange platform to allow bots to execute trades and manage the trader's portfolio.
Yes, it's legal to use trading bots. Although some people do have their objections to how automated trading impacts the markets, there are no rules or laws in place that keep retail traders from using trading bots.