Lastly, set up two-factor authentication. This procedure greatly increases the security of online accounts and ensures that your Twitter account is less likely to be compromised in the future. To do this, go to Twitter settings and tap “Settings and Privacy” -> “Security and Account Access” -> “Security” -> “Two-factor authentication”. Twitter offers you the option to choose between SMS, authentication app, and security key methods. Pick a method and follow the instructions displayed on Twitter.
If you are no longer able to log into your Twitter account, the hacker has probably already changed your login details. In this case, contact Twitter. Twitter support will then help you with reactivating your account.