If you do any kind of research that requires earth data, you might be familiar with NetCDF files. The way I like working with these files is using CDO (Climate Data Operators). However, I have some data what CDO won't accept, because it has too many dimensions. The usual is 4 I guess. That makes room for longitude, latitude, time, and whatever it is you're actually interested in. My data has 5 dimensions, it just has an extra "year" dimensions that only has the starting year of the data, so it's actually useless. This has me resorting to NCO (NetCDF Operators), which it honestly way over my head. I wanted to get back into the warm and safe embrace of CDO as fast as possible, so this is what I did. To do this you need to have NCO installed (if you are on arch like me it's a huge pain, I ended up very unhappily using conda).

ncks -C -O -x -v dimension_to_delete input.nc output.nc 

# Ok so this actually removed the "variable" not the dimension. I don't know enought to know the difference
# But I know I had to remove the variable and the dimensions ("year" in my case) for CDO to read it
# So this next bit gets rid of the "dimension"

ncwa -a dimension_to_delete input.nc output.nc

And that's it. That ncwa uses a crazy amount of RAM by the way. So you might need to like, split up the file into smaller parts first. Good luck figuring out how to do that with NCO.

EDIT: Quick way to get time slice from nc file:

ncrcat -F -d time,start_index,end_index input.nc output.nc