Study fan fiction to get ideas. The most popular outlets are magazines and Web sites.
Write as often as you can. Also, read and edit your work. Writing requires practice!
Be creative in your plot ideas, but keep it true to the show's or book's format and chemistry.
Avoid writing long descriptions or frequent attributions (like a lot of "he said" and "she said"). Don't be too wordy.
Go for the crossover appeal. Combining two or more different shows in one story is always popular.
Learn how to do better from the feedback. Don"t be afraid to take criticism from those who read your work.