Hey Albert!
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! š