How do I return only selected fields from the model and its relation

Can you provide the current state of your code and errors?