How does congress repeal a law?

Specifically, let’s say a certain law enters the U.S. code as a more or less unrelated rider X on bill Y. If bill Y gets signed into law, and congress later decides it doesn’t like the ramifications of X, how do they get rid of it (assume whatever sufficient majority of Senators and Representatives are in agreeance that it should go)?

Do they simply vote to declare X null and void? Must they repeal the entire bill? Or must they enact a new Bill/Act specifically repealing X, which itself may acquire rider Z along the way relating to something else entirely?

They repeal it the same way they enacted it: by introducing a bill to amend the earlier bill. There’s no requirement they repeal the entire bill, they can repeal the rider and leave the rest.