If your hair is thinning then don't relax again and don't use any sort of chemical on your hair like dye until you have found out what is causing it it.
Go over to the 4 board to see posts on people who have bald patches in their hair and have been force to go natural because of it. Some of them still don't have hair in places.
You should go to the doctor to have a blood tests to check you don't have any vitamin and mineral deficiencies and hormone problems.
If the tests reveal nothing then you need to look at your lifestyle i.e. do you sleep enough, eat properly and how you manipulate your hair.
Only once your hair grows back have another relaxer. However get this relaxer done at a salon where the stylist doesn't go over your old processed hair.
In regards to getting the same texture back you can't. You have to cut your hair off and start again because once hair is permanently damaged by chemical or thermal processing you can't fix it as hair is dead. You can however cheat and use rollers to make your hair have a more even curl pattern.