Honda four wheeler starts, but doesn’t move.

My 2000 Honda rancher es, doesn’t move. It’s an automatic and four-wheel drive.
It starts and will shift into first gear and reverse, but doesn’t move. After a few minutes of running it completely stops shifting. So we turn it off and let it sit a few minutes, when we turn it on it shifts again.
It will not manually shift at all.
Any ideas on what the problem could be?