You can do this via the admin console. From a Google search
https://bigfix-wiki.hcltechsw.com/blogs/autorelayselection/?lang=en_us
You can also create a fixlet to do this, see this example on Bigfix.me
Things to consider:
How many endpoints do you have
How many relays do you have
Where are the relay proximity to endpoints
Does your network have any restriction regarding ICMP (used for relay selection)
Do you have low latency / low bandwidth / VSAT sites that do not have a local relay
For most cases auto relay selection works well is you have relays well placed to support the location where you have endpoints but you can find cases where an endpoint selects a remote relay that is on a very remote connection purely as its hop count is lower due to your network routing tables. There are client setting you can add to limit the max distance to a relay, check out the client settings guide.
The following article may also be of help for you https://help.hcltechsw.com/bigfix/10.0/platform/Platform/Installation/c_using_relays.html