What is the correct way to declare and use MarisDB user defined variables?
The main difference ist that you can use DECALRE ony in stored function and procedzres

DECLARE var_name


This statement is used to declare local variables within stored programs.

see manual

User-Defined Variables


User-defined variables are variables which can be created by the user and exist in the session.

see manual
Which means every user defined variable is accessible every where(in a session) not only in a stored procedure/function. So you set your user defined Variable in a stored procudure, you can get the value eve after the stored procedure ends. That is very helpful for debugging such procedures/functions.
Also when you DECLARE a variable, you set also its data type and size.
With user defined MysQL decides what it needs when You SET @a = 123455