How can I change my W-4 so I don’t owe again?

how do i check my paystubs to confirm that i am withholding the correct amounts federal and state (MA) so that I do not owe taxes