Purchase and install Tweaks for Twitter in the Mac App Store.
Open the Extensions tab of the Preferences window in Safari.
The "Enable in Safari…" command in Tweaks for Twitter does this automatically.
Otherwise, you can open Safari manually and select "Preferences…" from the "Safari" menu in the main menu bar.
In the Extensions tab of the Safari Preferences window, check the box next to Tweaks for Twitter to enable it.
Press the "Edit Websites…" button to open the Websites tab of the Safari Preferences window. Under "Configured Websites", select "Allow" in the popup menu for
twitter.com to allow Tweaks for Twitter to run on Twitter.
You only need to enable Tweaks for Twitter once in Safari, and then it will remain enabled permanently. It will remain enabled even after you install new versions of Tweaks for Twitter and Safari. If you ever need to disable Tweaks for Twitter, just uncheck the box in Safari Preferences.
If you're having trouble enabling the extension in Safari Preferences because the checkboxes don't respond to clicks, please see the Apple support document on this subject. For more details, see my article Safari bug: can't enable extensions on Catalina.
If Tweaks for Twitter is missing in Safari Extensions Preferences, and you get "SFErrorDomain error 1" in the Tweaks for Twitter app, this may be a macOS bug with Launch Services. Please copy the following command and paste it into the Terminal app (located in the Utilities subfolder of the Applications folder).
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f -R /Applications/Safari.app