Sometimes I will feel the urge to go to the bathroom but it will turn out to be a smalle piece of poop followed by gas and a little mucus? Why

See below. Do u eat a lot of gas-forming foods like beans, cucumbers, broccoli, cabbage, brussel sprouts, cauliflower? Or perhaps a lot of dairy products? Gas from latter may be lactose intolerance; lactase tablets (lactaid/dairy ease) taken with meals can help digest the milk sugar. Simethicone (gas-x) or beano can help with others. If no help, see fp for evaluation.