Strongly depends on what kind of tools you want to use. This is a very trivial task with most programming languages ("Python/R/..."), if you want a command line tool you might want to look at NCO and especially its ncks (NetCDF Kitchen Sink) command.
For example, if I have a NetCDF file (output ncdump -h)
netcdf u.xz {
dimensions:
xh = 256 ;
y = 1 ;
z = 160 ;
time = UNLIMITED ; // (481 currently)
variables:
float time(time) ;
string time:units = "Seconds since start of experiment" ;
float xh(xh) ;
float y(y) ;
float z(z) ;
float u(time, z, xh, y) ;
}
I can extract for example the first time record using:
ncks -d time,0,0 u.xz.nc test.nc
Or, something closer to your question, select the first time record and slice the spatial dimensions:
ncks -d time,0,0 -d xh,0,5 -d z,0,5 u.xz.nc test.nc
Each time the manipulated NetCDF file is written to a new file. You can leave out the last argument test.nc to dump the output to screen, or simply dump the output of test.nc with ncdump.