Most cases cannot be prevented. Drinking a lot of fluids every day can help prevent kidney stones. Many cases of urethritis are caused by sexually transmitted diseases. So practicing safer sex could help prevent some cases of blood in the urine.
Long-term effects depend on the cause. Serious kidney infections or cancer may result in death. Many infections and kidney stones go away with treatment and have no long-term effects.
Blood in the urine itself is not contagious. If an infection such as a sexually transmitted disease is the cause, the infection may be contagious.