Jesus is talking to a group of people about what they as individuals should and should not do. The "you" is plural in "you have heard" and "I say to you." The "you" and "your" are singular in "Do not swear" and "carry out your oaths," but in some languages they may need to be plural. (See: [[rc://en/ta/man/translate/figs-you]])
This can be expressed with an active verb. Alternate translation: "God said to those who lived long ago" or "Moses said to your ancestors long ago" (See: [[rc://en/ta/man/translate/figs-activepassive]])
Here Jesus means that when people make a promise or when they say that something is true, they must not swear by anything. Some people were teaching that if a person swears by God that he will do something, then he must do it, but if he swears by something else, such as by heaven or earth, then it is less offensive if he does not do what he swore to do. Jesus says that swearing by heaven or earth or Jerusalem is just as serious as swearing by God because those things all belong to God.