Disclaimer: I'm not claiming expertise on twitter or security but these ideas may help. This is aimed primarily at windows users but also applies to twitter users in general and may help users of other social media.
If you use linux you probably already know a lot more than me.
If you have even the remotest inkling that your computer has been hacked the first thing you should do is download an anti-malware tool, for example the free malwarebytes, then run a full system scan. This may take some time - think a trip to the shops for ingredients and then a homemade cake and pizza time. There's no point in proceeding to further steps until this stage is done. You shouldn't be online or physically connected to the internet during this process.
Any credible virus will have disabled your windows firewall and automatic updates go to your control panel (security center) and fix this, everything should be on. It never hurts to reboot.
You should go back online now.
After your reboot go back to your control panel security center and verify that your automatic updates are still on. If they are not type "fix automatic updates for windows" into your favorite search engine and fix this.
After you reboot go back to your control panel security center and verify that everything is still on.
Assuming they are then it's time to consider your firewall - free windows firewalls review. Install the firewall you've chosen successfully. Again, you should probably reboot and check that everything is fine via security center at this point.
With any luck, your computer is now more secure than it formally was.
At this point you might well want to visit privoxy.org and instal their free filtering software - this, I have found has forewarned me of various twitter attacks before they've actually happened and alerted me that others I trust have had their accounts compromised.
You may find - with the better coded twitter hacks - your friends / followed send you direct messages that direct you to hack sites because their accounts have been compromised (more on this later).
Although firefox with its constant updates may seem like a string vest (pest) to the average user imagine how much trouble it presents for a black hat hacker or an apps coder and think yourself lucky.
An aside, you can also impress your friends by selecting from among the firefox themes and changing the appearance of your browser more often than the average "hacker" changes their underwear. There is even an extension which does this automatically for you based on your choices (personas rotator).
Having a sexy browser is not your immediate problem.
Many twitter abusers seem to gain your trust by following you - if you are sensible you will check their timelines before you follow back - maybe you think, "they appear entirely innocent, give a newbert a boost" and follow back then they (or a malware twitter app hijacking their account) sends you to a place which is not what it purports to be and attacks your computer.
With firefox installed you can now take some added precautions to ensure this type of skullduggery shouldn't happen again. I have tried and tested various methods but what seems to be most convenient is downloading the long url please extension for firefox - this will prompt you to reboot firefox and you should (not your whole computer).
Upon returning to twitter and loading a page, mousing over a tiny url, you should see something like this:
So, you no longer get fooled by fake links - (none of the example links, in the image, are fake but 100% genuine).
In most cases on twitter you will find none of the above steps were necessary (but they can't hurt) and you simply go to your profile name in the top right hand corner of your twitter page, click settings, then applications, remove untrusted applications from your list, change password, log out, delete cookies and everything should be fine.
Always search on an app before allowing it access to your twitter, or any other, account.
Retrieve the data from your machine, while it works, back it up and then proceed.
addthis This is my favorite firefox app to date - installing this will allow you to add shortened links to social media posts and allow you to share shortened links to maximum effect - hopefully these will be beneficial to users of your favorite media.
Personally I think linux represents a cheaper and more secure alternative to windows but that is a blog beyond my expertise.
Further Reading: Tor - you might also consider running tor with a seperate browser, e.g. google chrome, for added security though this has limitations on certain media - i.e., youtube.
Corrections / suggestions should be addressed to @AlexandrCox on twitter or posted below.