To be honest, if you are not from a place, or social group where "ain't" is used, as part of the dialect, you generally can't use it correctly.
One exception would be if you were trying to sound like someone from a place or social group like that. That might not be wise, as you might sound like you were making fun of that accent.