How to achieve 2d crisp pixelated lines

Hello, i’ve saw some games rendering a 2D pixelated line, a example of that is Stardew Valley fishing, also on the game “Celeste”, where in some levels there is a pixelated line on the background, i want to know how to make something like that, i’ve tried to use line renderer but that isn’t what i’m looking for, as they dont give me pixel-perfect lines, instead they give me antialiased lines…

Can you explain it a bit more detailed?

You could try drawing your own line and then implement it as a picture.