Trying to control DC motor with ultrasound sensor

I am relatively New to Arduino and need your help to control my motor. Actually i made a code and the problem is that the ultrasound sensor doesn't work at all. It isn't displaying the distance between the object and and the sensor. Can you help me please! Here is my code:

int enableBridgePin = 10; 
int forwardPin = 11;
int backWardPin = 9;
int tickPin = 2;
const int trig = 5;
const int echo = 6;

int dt;
int distance;

float rotationSpeed[50];

void setup() {
  pinMode(enableBridgePin, OUTPUT);
  pinMode(forwardPin, OUTPUT);
  pinMode(backWardPin, OUTPUT); 
  pinMode(trig, OUTPUT);
  pinMode(echo, INPUT);
  Serial.begin(9600);

  digitalWrite(forwardPin, LOW);
  digitalWrite(backWardPin, LOW);
  
  interrupts(); 
  digitalWrite(enableBridgePin, HIGH);
}

void loop() {
  analogWrite(enableBridgePin,255);
  
  digitalWrite(forwardPin, HIGH);
  digitalWrite(backWardPin, LOW);
  
  distancefonction(dt, distance);
  if(distance>5){
   detachInterrupt(digitalPinToInterrupt(tickPin));
   digitalWrite(forwardPin, LOW);
   }
  
}

int distancefonction(int dt, int distance)
{
  digitalWrite(trig, LOW);
  delayMicroseconds(2);
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  dt = pulseIn(echo, HIGH);
  distance = 0.034/2*dt;
  Serial.println(distance );}

Thank you for posting your code properly!

To determine the problem, we need to know what modules you are using (post links) and exactly how everything is wired, so please post those details.

It is always best to get each piece of the project working individually, use standard example code, before putting the pieces together. If you have the HC-SR04 sonar module, pick one of the on line tutorials and follow it to make sure the sensor works before proceeding.