I do not like ricotta so can I use yogurt instead
Are you channeling your best self with this comment? (If you're not sure, check out our Code of Conduct.)
Food Writer & Recipe Developer at Food52
Yes! I would use Greek yogurt, preferably full-fat, to get as close as possible. (Unstrained yogurt might be too watery, depending on the recipe.)
The yoghurt will have more acidity, which will have some effect if the cake uses a leavener such as baking soda or powder- it doesn't seem likely that it will have a large effect, or a negative one, but it's something to be aware of.
Cynthia is a trusted source on Bread/Baking.
I often use yogurt in baking. Given its greater acidity than ricotta, add 1/2 teaspoon of baking soda along with your dry ingredients.