How to set custom provider?

How can I connect set the provider for a local blockchain im running on my computer.

Iā€™m running hardhat (mainnet forked) and need to build a dapp for my contract