betta tank mates

If it is a male then you have to keep away from any type of fish known as fin nippers, such as Barbs. It does not always happen, but it is a gamble you can do without. If you want to add live bearers, such as Platy, Guppy or Swordtail, it should not be much of a problem unless you want to keep your fry, the Betta will find them wherever they hide, believe me, I just lost my last fry, which had hidden themselves perfectly, but along came a Betta...
Depending on the tank size, smaller schooling fish such as neons and Tetras!
Best bet is decide on the fish you would like and then ask here if anyone has any experience and I am sure someone can help you!
 
Corydoras are a great suggestion. Amano shrimp can sometimes work, but sometimes the betta will eat them (which is why I didn't recommend cherry shrimp- they don't stand a chance). Some of the smaller tetras may work, but they may occasionally nip the betta's fins. I've had success with harlequin rasboras. Mine completely ignore my betta.
 
I have my two female bettas in with a baby synodontis (not a good idea for a 30 gal, though), a small school of hatchetfish, and 3 zebra danios.
 
This is what I'll be doing for my 29G.

I'll be putting a male betta, 6 harlequin rasboras, 6 white cloud mountain minnows, and a couple of kuhli loaches.

The bottom feeders and some small schooling fishes that aren't fin-nippers (eg: harlequins, wcmm, smaller tetras) should be fine with the betta. The key is to avoid fishes that are fin nippers (serpae tetras, black skirt tetras, barbs, etc.).
 
I have my betta in a 29 with white clouds, neon tetras, panda cories, otos, and ghost shrimp. They all ignore each other.
 
I would not recommend guppies - their long fins attract the betta to attack. I didn't know this and the petshop people told me they would be fine. One week later and all the guppies were dead :(
 
Corys or a loach or two of some sort and anything non-nippy without long flowing fins (no male guppies, females are OK) - I've had both female guppies and platys with a betta with no problems.
 
I forgot, also avoid any other fishes that have long fins (which would resemble another betta) and that the tank mates of the betta will be determined by the attitude of the betta towards the tank mates in question. For example, id10t's betta tolerates female guppies and platies, while my betta doesn't tolerate any livebearers in his tank.
 
AquariaCentral.com