If you are talking about an in-ground pool, you simply hire a pool architect. They will figure out how much dirt needs to be move or removed, what retaining walls need to be built, etc. Yes, you will need a building permit from your city or county, and if you belong to an HOA, the HOA will need to approve your designers plans before you start construction. Most municipalities and states have laws regarding whether a private pool needs fencing. You'll just have to research that based on where you live. If there is no hole and no pool on the site, then no fencing would be required on a flat yard.
How much a pool costs depends on the size of the pool and the construction. People can get a small concrete in-ground pool on flat land for $25-$30K. If you are moving a hill, building retaining walls, and or creating a fancy features it can run in the hundreds of thousands. A tiny fiberglass pool might be $8K. Any all of that doesn't include the maintenance, cover, and increased liability insurance you'll need.