This idiom is used when you benefit from two things that are different. Do you think that your sentence fits that description?
I’ll try to give you an example:
„I work in a big city but I live in the country so I get the best of both worlds: big city life with shopping, theatres and nice restaurants on the one hand and the calm and peaceful life with my family in our tiny house and garden on the other hand.“
Have a nice day! 🙂