Count deep nested tables From this SQL schemas I want to count the number of times a user is in a contest.

SELECT * FROM users u
LEFT JOIN trials_has_users tu ON (tu.users_id = '1')
LEFT JOIN trials AS t ON (t.id = tu.trials_id)
WHERE u.id = '1';

Previously, I have the expected number of lines, but I want to make a count
SELECT contest_total FROM users u
LEFT JOIN trials_has_users tu ON (tu.users_id = '1')
LEFT JOIN (
    SELECT 
        id,
        COUNT(*) AS contest_total
    FROM
        trials
    WHERE deleted_at IS NULL
    GROUP BY 
        id
) AS t ON (t.id = tu.trials_id)
WHERE u.id = '1';

Previously, have 6 rows want 1 (current user id) need LIMIT 1 ?
SELECT contest_total FROM users u
LEFT JOIN trials_has_users tu ON (tu.users_id = '1')
LEFT JOIN (
    SELECT 
        id,
        COUNT(*) AS contest_total
    FROM
        trials
    WHERE deleted_at IS NULL
    GROUP BY 
        id
) AS t ON (t.id = tu.trials_id)
WHERE u.id = '1'
LIMIT 1;

I would like to receive the number of contests in which the user has participated. My query is right ?
As ypercube pointed out, you want to use COUNT(DISTINCT t.contests_id) here to get the unique count of contests per users. All credit goes to ypercube on this one, but for a readable version of the example query on how to do this:
SELECT u.*, COUNT(DISTINCT t.contests_id) AS contest_total 
FROM users AS u 
LEFT JOIN trials_has_users AS tu 
    ON tu.users_id = u.id 
LEFT JOIN trials AS t 
    ON t.id = tu.trials_id 
WHERE u.id = 1 AND tu.users_id = 1 
GROUP BY u.id;