simple tracking system

I read about people track weather balloons on the internet and wanted to try that. I have no idea where to start, like how to write the code and what extra electronics I need.

Go back to the internet and research your project to broaden your knowledge about what you want to do. Google is your your friend just using simple search terms. I've seen a good bit about "near space" amature balloon projects.