The rules around access are different for Housing Associations and Local Authorities.
Housing Associations are limited to their tenancy agreement and have to issue a letter stating their intention to seek possession of the property. This can sometimes take unto 3 months to gain access and you need to ensure your back office is flawless or you’ll struggle to get possession.
Local Authorities have a number of options but the one that probably works best would be the Environmental Protection Act 1990 Section 79 and 80 Abatement Notices. These sections are specific to statutory nuisances which in laymen terms means the tenant is preventing the Local Authority from carrying out essential maintenance/checks which are used to demonstrate electrical safety. The benefit of this act and sections is that the order is in place forever afterwards. Meaning its easier to gain access in the future.
As mentioned in the Housing Association comment you would need to ensure that your back office is flawless. Demonstrating you have given the tenant every opportunity means the magistrate will lean more towards you when making a decision.
A few Local Authorities used Section 54 of the Housing Act but this only really worked on 9 out of 10 tenants. The problem you have with this is that Section 54 only gives the tenant a forceful nudge, if they decide not to let you in you then have to seek possession which is a further delay.
Hope this helps