Okay, first and foremost, males can't be with any other bettas. Females can stay with females but check that they aren't plakats. Females should also be in groups of 6-8 no less to spread out aggression. IMO if you're keeping a betta with other fish you should always have an extra tank handy in case it doesn't work out. Bettas shouldn't be kept with:
nippy fish (neons, danios, etc.) some people are okay with keeping them together but I wouldn't risk it.
fancy-tailed/very colorful fish (bettas will be fooled in thinking it's another betta) some people have kept them together but I wouldn't risk it.
Gouramis/paradise fish
any fry that it could fit in its mouth
that's all I can thnk of right now
They can be kept with:
cories
otos
plecs
snails
once again, that's all I can think of.