How can I calculate inaccuracy in machine learning models if our dataset is biased?

I have a classification project where the dataset is biased towards a particular class. I’m concerned that if I use accuracy as the evaluation metric, it might be misleading. Can someone suggest a way to calculate inaccuracy that takes into account the bias in the dataset? Also, any suggestions on how to deal with biased datasets in machine learning would be greatly appreciated. Thank you in advance!

Here’s my code that you can refer to:

Test Arham is testing for showing Srishti