I have a user table that has 4 rows with id = 1, 2, 3, 4. I delete the row with id = 2 and insert another user and the user will get id = 5. What will happen to the id = 2? Will it be used again or do I rearrange the ids? Rearranging ids doesn't make sense if I have a large amount for every delete operation.
You don't do anything. The deleted IDs are gone forever.
No, that isn't a problem.
The primary purpose of the ID is simply to be unique. Deleting some IDs never to be seen again doesn't affect the uniqueness of others. Most DB engines provide an automatic ID assignment capability, you should use it.
Just make sure you allocate enough bits in your ID to provide enough room during your application's life, that's all you have to do. Do not try to roll an id recycling system.