和 means 'and', and so does 而. What is the difference between the two. I also know that 而 means 'but', and the second question is what is the difference between 而 and 但. Give me an example sentence, please.
When you use 而, you are always expressing some kind of adversative meaning weaker than 但. Most of the time they can substitute each other but not 100% certain.
Example 1: both are fine
这件事很难，而那件事很容易。 => This thing is difficult while that one is easy.
这件事很难，但那件事很容易。 => This thing is difficult but that one is easy.
Example 2: 而 is better here
他没有出国，而是留在了国内。 => He stayed in home country instead of going abroad.
Example 3: 但 is better
这杯水不甜，但富含营养。 => This cup of water is not sweet but full of nutrition.
The differencies are subtle, taste them in more practice.
It's clearer to distinguish 而 from 和. Remember 和 has no adversative meaning, and in most cases it connects objects:
Tom and Jerry are good friends.