How do I change URL structure of my website without losing it's ranking?
Noreen, I don't think I can provide a comprehensive answer to your question, but I'll add my own experience to the mix.
I recently switched from one content management system (CMS) to another. The previous one had a database. The new one did not (flat-file). I kept the URL structure exactly the same for porting over all the old articles I had written.
Note of importance: ensure that you have a global redirect (404 page) setup. This page can be simple, but should at least have the global website navigation. The file where this information needs changed is the ".htaccess" file. If you know your way around code you can change it yourself. If not, you can search and find boilerplate code to use.
Some content management systems by default don't use "search engine friendly" URL structures. The result is something like "yourdomain.com/blog/12420291942.php" that doesn't mean much to your users or search engines. Even if a user bookmarks such a page, they may not remember what it is about without revisiting it.
So if you switch to search engine friendly URL structure (usually referred to as the "mod rewrite" - again search for more detail) search engines and users will be able to make more sense of your content. Having redirects (permanent or temporary) in place will also funnel people that try to visit old links to a page that can refocus their search for your content.