Choose the sun position (i.e. direction) in world space and give it a W component equal to zero. Then apply the usual transformations: model-view matrix, projection matrix, division by W, viewport transformation. Note that NDC Z will be greater than 1 (unless the far plane is at infinity), so you can’t just feed it to OpenGL as a normal object as it will get clipped out by the far plane.

If you want to render the sun using OpenGL, you can’t just treat it like a normal part of the scene. If you pick a point that’s closer than infinity, then it’s going to move if the camera position moves. If you pick a point at infinity it’s going to be clipped out by the far plane (unless your far distance is at infinity, and maybe even then). The usual solution is to have a separate model-view matrix for rendering the skybox (which needn’t be a literal box); this has the same rotation as the real model-view matrix but no translation, so the origin is always at the view position. You still need to pick an appropriate depth so that the sun is behind everything but the skybox.