washing machine timer replacement and install

my washing machine timer is not working correctly you can set it but after it fills then washes it stops wont empty or spin what can I do ? if it needs to be replaced how do I do it and is it hard to do?