if I breast feed baby won't take bottle at the same time ?

If I need to go somewhere for more than 3 hours and I have to leave the baby what am I gonna do if baby only wants my breast. Or can I extract my milk and baby will take it in a bottle ?