Straightening tilted viewport
If it's the viewport camera, simply hit NUMPAD1, NUMPAD3 or NUMPAD7 to get into an aligend view. Alternatively use the View menu (Right, Front or Top).

If your camera object got tilted, open the properties with N, find the rotation values in the Transform panel and find the value that isn't quite 90 or 0 degrees and enter a clean value.