Very nice Question! Please be careful during each step:
1) First fill 5 liter bucket, and transfer it's water to 3 liter. Fill 3-liter bucket completely from it, so now you have 2 liter water in 5 liter bucket.
2) Now, empty 3 liter bucket, & transfer that 2 liter water from 5 liter bucket to it.
Now, you have an empty 5 liter bucket + 2 liter water in 3 liter bucket.
3) Now, fill 5 liter bucket completely, and fill 3-liter bucket completely, which had 1 liter space empty, so, Now, you have 5 - 1 = 4 liter in 5 liter bucket.
You Got that!! Congrats!! If You 're thirsty by that hard work, then you can drink that water, if it is clean!! :)
Hope this helps!