The $db variable is an instance of your class. It's not an instance of the msyqli class. When you call methods of your class, they must exist in your class.
An alternative would be for your class to extend the mysqli class. In this case, if you called the ->prepare() method, it would be calling the base mysqli ->prepare() method.
However, I suspect your intention is to reduce the amount of code you have in your main application code to run each prepared query by having a class method that performs all the repetitive steps needed when you prepare/bind inputs/execute/bind the result/and fetch the data?
You kind of need to define what you are trying to accomplish with your db class before you go any further.
As to your existing class definition, it's not using the call-time connection details and it has three different places where it can make a database connection. It needs definition and cleanup before you try to add anything else to it.
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.