To keep coffee grounds from going down the drain always dump the coffee grounds straight into the trash can or compost.
If you do get some coffee grounds in the sink from washing the filter basket or reusable filter you can use a mesh drain screen.
Although small amounts of coffee grounds won't likely clog your sink drain or sewer system it's best to not allow the coffee grounds to go down the drain when possible.
When brewing your coffee, you should choose a paper filter or a reusable filter with a mesh.
The paper filters and reusable filters capture the majority of coffee grounds, preventing the coffee grounds from entering your plumbing system.
Paper filters are also especially effective at trapping fine particles and oils, which can cause clogs.
If you do get coffee grounds down your drain and it clogs you can use a mixture of baking soda, white vinegar and warm water.
Then pour it down the drain and allow it to work for 30 minutes or so.
Then you can pour some hot water down the drain or run the faucet to clear out the coffee grounds and the baking soda and vinegar mixture.