Please look at the articles of the exchange you are using as each exchange does it differently.
- Binance: https://www.binance.com/en-en/support/faq/how-to-create-api-360002502072
- KuCoin: https://www.kucoin.com/support/360015102174-How-to-Create-an-API
- Bittrex: https://bittrexglobal.zendesk.com/hc/en-us/articles/6448530732571-How-to-create-an-API-Key-
- Gate.io: https://www.gate.io/help/guide/17521/how-to-utilize-api
- Huobi: https://www.huobi.com/support/en-us/detail/360000203002
- Kraken: https://support.kraken.com/hc/en-us/articles/360000919966-How-to-create-an-API-key
- Bitvavo: https://support.bitvavo.com/hc/en-us/articles/4405059841809-What-are-API-keys-and-how-do-I-create-them-
Only a few exchanges are listed here. If you are using another exchange, make sure the exchange is in the list of supported exchanges and look up the article on how to create an API access from the exchange you want to use.