Can I block a creature and before my creature dies sacrifice it or does it die while taking damage that would normally kill it?
You can sac in response to it dying with the right cards. Are you thinking anything specific?
Let's say he's attacking me and I use a creature that if I sacrifice it , it gives an ability can I block him and sacrifice it at the same time without taking damage
you can sac it before damage is
dealt
But would that keep that creature from damaging my life
yes
Unless it has trample
Just so you're clear, your creature would not be around during the combat damage phase, so although your opponent's creature is blocked and won't cause you damage,(unless he has trample), your creature will not assign damage.