Usually replacing the battery requires reprogramming if it is a rolling code type. If it has small code switches inside, then that is not the story. Do you have another remote and does it work? If so, replace the bad one with the correct universal type from a home center.
If no remotes work with it, then the receiver is failing, and that usually means replacing the circuit board.