First Example: Mario has been dating Erika for six months, but he also likes Tina and would like to ask her out. Mario wants to have it both ways. He would like to date both Erika and Tina.
Meaning: to have (something or it) both ways means to get the best of a situation by getting the benefits of two opposite things. In this example, Mario likes his relationship with Erika, but he also likes Tina. However, he can't date both of them at the same time because he has been dating Erika for six months. This idiom can apply to any situation where there are two opposite things that can't be done at the same time. It's used as an infinitive in this example.
Here is another example: John works long hours and makes a lot of money, but he would like to have more time off to do the things he enjoys. However, John can't have it both ways. He either works hard and makes a lot of money, or he takes more time off and makes less money.
Meaning: In this case, the two opposite things are working a lot and taking more time off. John can't make a lot of money if he does both of these things at the same time. He must choose one thing. In this example, it's used with the modal "can't."
Meaning: to have (something or it) both ways means to get the best of a situation by getting the benefits of two opposite things. In this example, Mario likes his relationship with Erika, but he also likes Tina. However, he can't date both of them at the same time because he has been dating Erika for six months. This idiom can apply to any situation where there are two opposite things that can't be done at the same time. It's used as an infinitive in this example.
Here is another example: John works long hours and makes a lot of money, but he would like to have more time off to do the things he enjoys. However, John can't have it both ways. He either works hard and makes a lot of money, or he takes more time off and makes less money.
Meaning: In this case, the two opposite things are working a lot and taking more time off. John can't make a lot of money if he does both of these things at the same time. He must choose one thing. In this example, it's used with the modal "can't."