I have a site collection. In that site collection i created sub-sites for different departments. Now i want to give the permissions to the sub sites. For eg: If one department sub site can not access another department sub site.
Log into the subsite. Under the gear icon in top-right corner there's a link to Site Settings. Go to Users and Permissions > Site permissions.
First you need to break role inheritance (there's a button on the ribbon). It allows to specify unique permissions for an object (by default objects have the same permissions as parent).
After that you can remove and add whatever permissions you want.