Taking a class

Is it possible if I didn’t got a pass my math class I could retake it at an community college and transfer the credits over?