If you are referring to replacing something that is broken, old, or not working/inoperative, then you replace it with a new one . If you are referring to filling the role of someone or something with a substitute, then it is ‘replaced by’. “Human bank tellers have all but been replaced by ATMs.”