When we restore the database system should have Exclusive lock.
The error means that some process is using this database,we should kill those process which are using database,
Otherwise use this command :
ALTER DATABASE <> SET MULTI_USER WITH ROLLBACK IMMEDIATE;
RESTORE DATABASE <> FROM DISK = ‘C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\YOURDB.bak’