The best of both worlds means that when you have been asked to opt between two choices, you have the advantages of both the two.
It is like getting the best of both the alternatives which are seemingly opposite to each other. You get the combined benefits of two contradictory situations.
1. School teachers are usually able to enjoy the best of both worlds as their working hours enable them to spend more time at home.
2. Mrs. Gupta was looking forward to spending time with her grandchildren after retirement and yet she felt sad at leaving her office because she wanted the best of both worlds.
3. Teenagers are usually able to enjoy the best of both worlds.