count total matching id if a single column contain multiple value separated by comma
The root cause of your problem is that database is not normalized. Assuming your table looks like:

CREATE TABLE COURSES
( APPLICATION_CODE ... NOT NULL PRIMARY KEY
, ...
, TEACHERS VARCHAR(100) NOT NULL );

INSERT INTO COURSES (APPLICATION_CODE, TEACHERS)
VALUES ('MA101', '1,2,5');


The correct thing to do is to normalize this into two tables:

CREATE TABLE COURSES
( APPLICATION_CODE ... NOT NULL PRIMARY KEY
, ... );

CREATE TABLE COURSE_TEACHERS
( APPLICATION_CODE ... NOT NULL 
, TEACHER_ID INT NOT NULL 
,     PRIMARY KEY (APPLICATION_CODE, TEACHER_ID) );

INSERT INTO COURSES (APPLICATION_CODE)
VALUES ('MA101');

INSERT INTO COURSE_TEACHERS (APPLICATION_CODE, TEACHER_ID)
VALUES ('MA101', 1), ('MA101', 2), ('MA101', 5);


In this case, it is sufficient to count the rows where TEACHER_ID = 1

SELECT COUNT(1) 
FROM COURSE_TEACHERS
WHERE TEACHER_ID = 1;


Not only will it be easier to ask questions like this, the queries will be much more efficient since they can utilize indexes in a way that is not possible in your current model.

That said, if you know that the teacher string always looks like for example:

' 1, 2, 5,'

You can use LIKE to count the rows:

SELECT COUNT(1) 
FROM COURSES WHERE TEACHERS LIKE '% 2,%';


Pitfalls, if the last item is not terminated with the separator token (in this case ",") you need to handle that in a special predicate. The same goes for the start item, it needs to start the same way as the remaining ones.

If you can not trust the string to be in this simple form, you may be able to come up with a regular expression that describes a teacher item in the list of teachers.