It's not a good idea to do this as part of your INSERT query - it's too easy to have it repeated in multiple places in your code and make a mistake, or miss one if the cut-off age changes to 21 say.
Instead, this would probably be best handled by using a stored procedure on the database to check or insert:
CREATE PROCEDURE InsertWithAgeCheck
@PName VARCHAR(100),
@Age int,
@Dept VARCHAR(100)
AS
BEGIN
IF (@Age < 18)
RAISERROR('Too Young',18, 1)
ELSE
INSERT INTO MyTable ([Name], [Dept], [Age]) VALUES (@PName, @Dept, @Age)
END
GO