Q:

How can i add numbers near each line in index 0 in richTextBox?

for (int i = 0; i < richTextBox2.Lines.Length; i++)
{
    richTextBox2.Lines[i] = richTextBox2.Lines[i].Insert(0, i + " ");
}

Before that tried with the Insert:
richTextBox2.Lines[i].Insert(0, i + " ");

In both cases it's not adding any numbers.
For example if the lines are:
Hello world
Hi
Hello

Then i want it to be now:
1 Hello world
2 Hi
3 Hello

But the loop does nothing it's not adding any numbers.

A:

You can't modifiy the single line in that way. If you look at MSDN you will find this remark 

By default, the collection of lines is a read-only copy of the lines
  in the TextBox. To get a writable collection of lines, use code
  similar to the following: textBox1.Lines = new string[] { "abcd" };

So the correct way to reach you goal is 
string[]  lines = richTextBox2.Lines;

for (int i = 0; i < lines.Length; i++)
{
    lines[i] = (i+1) + " " + lines[i];
}
richTextBox2.Lines = lines;

A:

You can try using Linq:
using System.Linq;

...

richTextBox2.Lines = richTextBox2
  .Lines
  .Select((line, index) => $"{index + 1} {line}")
  .ToArray();

please, avoid redrawing UI (esp. RichTextBox) which can slow down your application, but build the data (lines, text) and then assign it in one go.  

