Sure, stop black people from stepping foot into your home or your store. Refuse to buy or sell with them. It's your right!
There are things you can do that I don't think are good ideas. There are things you can do that I think are immoral or even dangerous to yourself. I am not endorsing business owners being bigots, but they do have certain rights to exclude people from their private property and rights of association. I'm willing to meet them half way and say "if you don't want to do business with XYZ type of people, that's fine as long as you post a sign plainly stating that. No surprises after the fact".
Similarly if a technology company wants to exclude certain types of traffic or communication from its services, I'm fine with that as long as it is understood what is and is not allowed. As long as the forbidden content is described, they can go ahead and do it.