One fish is right. A 40 is a great tank size. Big enough to keep stable but small enough that it isn't too expensive.
We've all made mistakes especially early on. It is good to go very slow. Patience is important with saltwater. I still struggle with that, it just isn't in my nature to be patient.
You need to remember that salt water isn't as forgiving as fresh water and you can't keep as many fish. Another thing that is almost always true is only one of each type of fish. One damsel although I wouldn't recommend a damsel in a 40 gallon tank, Only one clown etc. that goes for body shape and often color too. For example dottybacks and basslets are the same general shape and even though they are different kinds of fish they can't be mixed. There are a lot of fish that would work well in a 40 gallon. Research each addition and add them in order of increasing aggressiveness. When in doubt about if a fish would work go to a forum and ask other hobbiests before you buy. It is usually best not to just ask the people at the fish store their job is to sell fish And unfortonately many are not very concerned with the fish's future.