Note the 5 hearts in the bottom right corner when visiting a neighbor.  These hearts represent the number of actions you can perform on your neighbor's farm. The types of actions you can perform are listed below.

Fertilize crops  or water Trees
When you visit a neighbor's farm, you can fertilize their crops or water their trees to help them grow and get a reward of 1 XP and 5 coins for each plot or tree you help with.
 

Harvest crops
On your neighbor's farms you can also harvest their ripe crops. Don't worry, harvesting those crops will not make them disappear for your neighbors. Even though you harvest them, they will still be there in your neighbor's game. When you harvest crops, you will have a small chance of obtaining that crop for yourself.

Clean decorations
You can also clean decorations on your neighbor's farm. Look for decoration items with a brush icon floating on top of it. An example is shown in the picture below. These can be cleaned and you will receive a small reward for this! In addition, your neighbour will also be able to collect a special reward after a decoration item has been cleaned.
 

Can't fertilize or clean
If you can't help a neighbor, don’t worry. You will receive 5 XP and 10 coins just for visiting a neighbor! Tap on the collect reward option at the bottom of the screen when visiting a neighbor's farm to collect this reward.