Part 4 and the first half of Part 5 of Spinoza’s Ethics are about ethics in the narrow sense. The first three parts of the book can be seen as an introduction to what the core of the book describes: a moral philosophy. They constitute the frame of Spinoza’s exposition of good life. In Part 4 he describes his ethics of emotions, so what we must do in order to avoid that our emotions make us behave in the wrong way. Like Part 3, it is followed by a summary. The first part of Part 5 gives an ethics of freedom and it is about our possibilities.
Maybe you expect that Spinoza presents a range of rules about what to do and not to do, like, for instance, the Ten Commandments in the Bible: “You shall not murder”, or “Honour your father and your mother”. Not so Spinoza. Even his summary of Part 4 doesn’t contain explicit rules to follow for leading a moral life but it describes how a good life looks like. The rules of life are implicit, although not difficult to infer.
Spinoza is a rationalist and knowledge is everything for him. Therefore I think that the heart of his ethics can be found in this quotation from Part 4 (Chapters 4 and 5):
“[T]he ultimate aim or highest desire ... is that whereby [man] is brought to the adequate conception of himself and of all things within the scope of his intelligence. ... Therefore, without intelligence there is not rational life: and things are only good, in so far as they aid man in his enjoyment of the intellectual life, which is defined by intelligence. Contrariwise, whatsoever things hinder man's perfecting of his reason, and capability to enjoy the rational life, are alone called evil.” For our freedom – treated in Part 5 – this means that in order to be free, we must understand (so trying to get knowledge) what freedom from being led by our emotions involves. We must not be blindly guided by them but try to understand what they do to us. This is the maximum possible, for in the end man is determined by nature. If you find this confusing and contradictory, I agree, for how can being free be compatible with being determined? But that is another discussion – a discussion that still is current – and here I want to restrict myself to clarifying Spinoza’s ethics.
How do you know whether you have knowledge of your emotions so that you will not be taken over by them? For in order to know what to do, you must know which emotions to follow. Spinoza makes this clear in proposition VIII of Part 4 and its proof:
“We call a thing good or evil, when it is of service or the reverse in preserving our being ..., when it increases or diminishes, helps or hinders, our power of activity. Thus, in so far as we perceive that a thing affects us with pleasure or pain, we call it good or evil; wherefore the knowledge of good and evil is nothing else but the idea of the pleasure or pain... Therefore the knowledge of good and evil is nothing else but the emotion, in so far as we are conscious thereof.” In other words: Good is what makes us happy and bad is what makes us sad, and to get knowledge of what makes us happy or sad is not difficult, at least not most of the time. This is the basis of Spinoza’s ethics.
Now you may say that we can fill in all this as we like. For example, sadistic behaviour might make someone happy, and so it would be good for him (but certainly not for the victim). This is not how Spinoza sees it. Spinoza’s ethics is a humane ethics. Some examples: Stand up for yourself, he says, but take care of others. Cooperate where you can. For doing so and helping each other is better for yourself and makes it is easier to become happy. “[I]n reality, Avarice, Ambition, Lust, &c., are species of madness, though they may not be reckoned among diseases.” (proof of proposition XLIV)
Moreover, don’t return hate for hate, for, “Hatred can never be good” (proposition XLV). As Spinoza explains in the proof of the next proposition: “... hatred is increased by being reciprocated, and can be quenched by love ..., so that hatred may pass into love ...; therefore he who lives under the guidance of reason will endeavour to repay hatred with love, that is, with kindness.”And a final quote in order to show how humane Spinoza’s philosophy is: “He who is moved to help others neither by reason nor by compassion, is rightly styled inhuman, for ... he seems unlike a man.” (note on proposition L)