Are you talking about replacing the slip yoke or the weld on yoke? The slip yoke is a no brainer, just line up the ears with the ears on the opposite end.
If you are replacing the weld yoke, then grind back whatever is left of the weld and chamfer the edge a bit. Install the weld yoke and line it up with the ears of the opposite end of the shaft. It's usually a tight fit so you may need to use a BFH or get the shaft warm. It should be warm from the ginding. When the yoke is fully seated in the tube, tack weld it on opposite sides, then go back and fully weld it in.
The shaft should be lined up square, but may not be fully balanced. If you get some vibes then you may have to get it balanced at a driveshaft shop.