It's unlawful for someone to discriminate against you because of your race when they are selling or letting property. So a landlord cannot, for example, refuse to let a house to a black person because of their colour. It is also unlawful for a landlord to discriminate in the way they treat tenants. The law applies to business premises, too.
The Race Relations Act does not apply where the landlord (or a near relative) lives in the property and shares some of the living space with the tenant (which includes a bathroom or kitchen, but not just a hall, staircase or entrance).
If you are a council or housing association tenant and you are racially harassed by other tenants, you should tell the council or housing association. Many organisations have policies to protect tenants against harassment. They may take out an 'injunction' through the courts, to get the people to stop harassing you. They may also be able to evict them.